Summary
Snipe-IT contains a CSS injection vulnerability in the Custom CSS field because some characters are incompletely sanitized and can have their HTML encoding reversed. A superuser who can save malicious CSS may cause other superusers' CSRF tokens to be exfiltrated, potentially enabling account takeover.
Affected context
The issue occurs in Snipe-IT deployments where superusers can create or modify Custom CSS content and that content is later rendered in pages viewed by other privileged users. Risk is higher when the application permits CSS features such as external imports or URL references and when CSRF tokens are exposed in a way that can be inferred through browser behavior.
Exploit preconditions
- Attack surface: The administrative Custom CSS field and pages that render its contents
- Required access: Authenticated superuser privileges capable of modifying Custom CSS
- Trigger point: Rendering the stored CSS in a browser session belonging to another superuser
- Why exploitation is possible: Incomplete sanitization reverses encoding for selected characters, allowing CSS syntax and external references to remain effective
- Additional condition: The targeted session must expose useful CSRF token information through page content or browser-observable behavior
Why this happens
The vulnerability results from incomplete output sanitization of user-controlled CSS. The application reverses HTML encoding for greater-than and double-quote characters, allowing data that should remain inert to regain syntax meaningful to a browser's CSS and URL parsers.
This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, because untrusted content is rendered without context-appropriate encoding and restriction. Treating CSS as harmless text, rather than as an active browser language with network capabilities, creates the injection boundary.
Potential impact
- A malicious superuser may cause requests to attacker-controlled external resources
- CSRF tokens belonging to other superusers could be exposed
- Privileged sessions may be abused to perform unauthorized actions
- Administrative accounts could be taken over
- Sensitive application data or configuration could be accessed or modified
General mitigation guidance
Mitigation generally focuses on treating Custom CSS as an active and sensitive input context rather than ordinary text.
Common defensive patterns include:
- Applying context-aware output encoding without reversing encoded characters
- Allowing only a narrowly defined CSS property and value subset
- Removing or blocking external imports, URL references, and other network-capable CSS features unless explicitly required
- Keeping CSRF tokens out of locations that can be inferred through rendered content or browser side channels
- Restricting Custom CSS editing to the smallest necessary administrative group
- Applying least privilege to administrative roles and session capabilities
- Using browser security policies, such as restrictive Content Security Policy directives, as defense in depth
How teams detect issues like this
Organizations can identify similar issues through:
- Static analysis rules for unsafe HTML rendering and context-inappropriate encoding
- Code review checks covering custom CSS, style attributes, URL-bearing CSS functions, and external resource loading
- Tests that verify special characters remain encoded and that disallowed CSS constructs are rejected
- Monitoring administrative changes to Custom CSS and reviewing unexpected outbound requests from application pages
- Policy enforcement that limits external content sources and blocks unapproved network destinations
Automated application security and code review tools may help identify incomplete sanitization, but rendered behavior should also be tested in a browser context.

