Skip to main content
CVE Vulnerability Database

CVE-2024-5125: Lollms-webui XSS and Open Redirect Flaw

CVE-2024-5125 is a cross-site scripting and open redirect vulnerability in Lollms-webui version 9.6 affecting SVG file uploads. Attackers can execute malicious JavaScript and redirect users to harmful sites. This article covers technical details, affected versions, impact analysis, and mitigation strategies.

Published:

CVE-2024-5125 Overview

CVE-2024-5125 affects parisneo/lollms-webui version 9.6, exposing the application to Cross-Site Scripting (XSS) and Open Redirect attacks. The vulnerability stems from inadequate validation of SVG files uploaded through the file-to-AI-module feature. Attackers can embed malicious JavaScript inside SVG files, which executes when the file is rendered in the browser. The same weakness allows unvalidated URLs inside SVG content to redirect users to attacker-controlled destinations. Successful exploitation can result in credential theft, unauthorized data access, phishing, and malware delivery. The flaw is tracked under CWE-79, Improper Neutralization of Input During Web Page Generation.

Critical Impact

Attackers can execute arbitrary JavaScript in a victim's browser session and redirect users to malicious sites via crafted SVG uploads.

Affected Products

  • parisneo/lollms-webui version 9.6
  • Deployments exposing the AI file upload endpoint
  • Installations rendering user-supplied SVG content in the browser

Discovery Timeline

  • 2024-11-14 - CVE-2024-5125 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-5125

Vulnerability Analysis

The lollms-webui application accepts SVG files through the module used to send files to the AI. SVG is an XML-based image format that natively supports <script> elements and event handlers such as onload or onclick. The application renders these uploads without sanitizing embedded scripts or validating referenced URLs. When a victim opens the file, the browser parses the SVG and executes any script it contains under the origin of the lollms-webui application.

Because the executed script runs in the application origin, it can read cookies, session tokens, and DOM contents accessible to the current user. The open redirect variant abuses <a> elements or scripted window.location assignments inside the SVG to send users to attacker-chosen URLs.

Root Cause

The root cause is missing input validation and output sanitization for uploaded SVG documents. The application treats SVG uploads as trusted image content instead of active XML documents that can carry executable script and navigational directives.

Attack Vector

Exploitation requires the attacker to deliver a crafted SVG through the file upload feature and a victim to open or preview it. The CVSS vector indicates local attack vector with user interaction, low confidentiality impact, and high integrity and availability impact on the affected component.

text
// Patch reference from web/dist/index.html
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <title>LoLLMS WebUI - Welcome</title>
-    <script type="module" crossorigin src="/assets/index-72c42fda.js"></script>
-    <link rel="stylesheet" href="/assets/index-f34702e1.css">
+    <script type="module" crossorigin src="/assets/index-50d6fa6f.js"></script>
+    <link rel="stylesheet" href="/assets/index-08a9f7b7.css">
   </head>
   <body>
     <div id="app"></div>

Source: GitHub Commit 9b0f6c4. The commit ships rebuilt front-end assets containing the sanitization fix for SVG handling.

Detection Methods for CVE-2024-5125

Indicators of Compromise

  • SVG files uploaded to lollms-webui containing <script> tags, onload, onerror, or javascript: URIs
  • Outbound HTTP requests from client browsers to unexpected domains after opening AI-shared files
  • Session tokens or cookies appearing in outbound requests to domains not associated with the application

Detection Strategies

  • Scan uploaded files at the storage layer for SVG documents containing scripting constructs or external URL references
  • Inspect web server access logs for uploads of image/svg+xml content followed by fetches to unfamiliar external hosts
  • Monitor browser Content Security Policy (CSP) violation reports for inline script execution originating from rendered SVGs

Monitoring Recommendations

  • Alert on any lollms-webui instance still running version 9.6 exposed to untrusted users
  • Track file upload volume and file-type distribution to identify anomalous SVG activity
  • Correlate authenticated session activity with outbound redirects to newly registered or low-reputation domains

How to Mitigate CVE-2024-5125

Immediate Actions Required

  • Update lollms-webui past commit 9b0f6c4ad1b9a2cd3466dcefaa278df30feed67e to obtain the sanitization fix
  • Restrict access to the AI file upload interface to trusted users until the patch is applied
  • Audit existing uploaded SVG files for embedded scripts and remove suspicious artifacts

Patch Information

The upstream fix is available in the parisneo/lollms-webui commit 9b0f6c4. Additional context is available on the Huntr bounty report. Upgrade to a release that includes this commit.

Workarounds

  • Block SVG uploads at the reverse proxy or application layer until patched
  • Serve user-uploaded files with Content-Disposition: attachment and a restrictive Content-Security-Policy to prevent script execution
  • Rewrite SVG uploads through a sanitizer such as DOMPurify with SVG profile enabled before storage or rendering
bash
# Example nginx configuration to block SVG uploads and harden responses
location /api/upload {
    if ($content_type ~* "image/svg\+xml") { return 415; }
}

location /uploads/ {
    add_header Content-Security-Policy "default-src 'none'; sandbox";
    add_header X-Content-Type-Options "nosniff";
    add_header Content-Disposition "attachment";
}

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

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

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.