Summary
A reflected cross-site scripting vulnerability in Arcane's unauthenticated /api/app-images/logo endpoint allows attacker-controlled data to be injected into an SVG logo response without proper escaping.
When a logged-in admin is tricked into visiting a crafted URL, attacker-supplied JavaScript runs in Arcane's origin and can leverage the victim's HttpOnly JWT cookie to fully compromise the admin account.
Affected context
This vulnerability affects Arcane deployments prior to 1.19.0 that expose the /api/app-images/logo endpoint.
It manifests when:
- The endpoint accepts a
colorquery parameter from the URL - The parameter value is inserted into an embedded
logo.svginside a<style>block usingstrings.ReplaceAllor equivalent direct string substitution - The response is sent with a
Content-Type: image/svg+xmlheader, and the application does not set a restrictive Content Security Policy (CSP) orX-Content-Type-Options: nosniff
Under these conditions, browsers treat the SVG as active content capable of executing script in the context of the Arcane web application.
Exploit preconditions
- Attack surface: Public, unauthenticated HTTP GET endpoint at
/api/app-images/logo - Required access: None to reach the vulnerable endpoint; successful impact requires a victim user who is authenticated to Arcane (e.g., an admin) and who visits an attacker-supplied URL
- Trigger point: The
colorquery parameter is reflected into the<style>element of the SVG document without escaping, allowing the attacker to terminate CSS context and inject<script>content - Why exploitation is possible:
- Direct string replacement is performed on the SVG template without HTML/CSS/JS context-aware encoding
- The response is served as
image/svg+xml, a script-capable document type in modern browsers - No CSP or
X-Content-Type-Optionsheaders are set to reduce or prevent script execution in the SVG
Why this happens
The underlying issue is a classic reflected cross-site scripting bug where untrusted input is inserted into an HTML/SVG response without proper escaping.
In this case, the color query parameter is injected directly into a <style> block in an SVG asset using naive string replacement.
Because the server does not apply encoding appropriate to CSS or XML/HTML contexts, an attacker can break out of the style context and inject <script> tags.
This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), as the application generates active content from user-controlled data without neutralizing meta-characters that change the document structure or introduce executable code.
Potential impact
- Execution of attacker-controlled JavaScript in the Arcane web application's origin
- Full compromise of an authenticated admin's session by abusing their HttpOnly JWT via authenticated API calls from injected script
- Modification of Docker container, image, network, and volume configurations through the compromised admin account
- Creation or deletion of containers and images, leading to service disruption or deployment of malicious workloads
- Exfiltration or tampering with application configuration and operational metadata accessible to the admin UI
General mitigation guidance
Effective mitigation centers on strict output encoding, context-aware templating, and hardening of browser-facing responses:
- Apply proper encoding for data inserted into HTML, SVG, and CSS contexts (e.g., escape special characters so user input cannot alter document structure).
- Avoid building SVG or HTML responses with raw string concatenation; use templating mechanisms or libraries that perform context-sensitive escaping by default.
- Treat all query parameters as untrusted, even for ostensibly simple presentation values like colors; validate against a strict allowlist of acceptable formats (e.g., hex color regex) before use.
- Where practical, serve static assets (such as logos) from fixed, non-user-influenced templates and separate them from dynamic data entirely.
- Deploy a restrictive Content Security Policy that limits script sources and, where feasible, disallows inline script execution to reduce XSS impact.
- Add
X-Content-Type-Options: nosniffwhen serving SVG and other content types to reduce unexpected script execution behaviors.
How teams detect issues like this
Organizations can look for similar vulnerabilities by:
- Static analysis and linting:
- Flagging direct string concatenation or
ReplaceAll-style operations that mix untrusted input into SVG, HTML, or CSS templates. - Detecting endpoints that take query parameters and use them in responses without routing through an encoding layer.
- Code review practices:
- Reviewing any code paths that generate SVG or other XML-based image formats dynamically.
- Verifying that user input included in
<style>,<script>, or event handler attributes is validated and encoded. - Checking for missing security headers (
Content-Security-Policy,X-Content-Type-Options,X-Frame-Options) on endpoints serving active content. - Dynamic testing and fuzzing:
- Using automated scanners or penetration testing tools configured to probe SVG, HTML, and JSON endpoints for reflected XSS.
- Manually testing query parameters for reflection inside style blocks or other executable contexts.
- Security policy enforcement:
- Integrating secure coding guidelines and automated checks into CI/CD pipelines that prevent merging code with unencoded user input in views.
- Employing web application firewalls or reverse proxies that can enforce CSP and security headers uniformly.

