CVE-2024-9900: Github.com/mudler/LocalAI Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-w6hh-w36c-vxmw
CVSS 5.4
CWE-115 CWE-79
Published
Advisory Summary

CVE-2024-9900 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-115: Misinterpretation of Input) affecting Github.com/mudler/LocalAI libraries in the Go ecosystem. The issue involves localai cross-site scripting (xss) vulnerability in its search functionality. Remediation is available by upgrading affected packages to version 2.22.0.

CVE-2024-9900 at a Glance

CVE Identifier CVE-2024-9900
GHSA Identifier GHSA-w6hh-w36c-vxmw
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-115: Misinterpretation of Input
Affected Product Github.com/mudler/LocalAI
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-9900

To remediate this vulnerability, upgrade all affected Github.com/mudler/LocalAI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/mudler/LocalAI fixed: 2.22.0
Upgrade github.com/mudler/LocalAI to 2.22.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/mudler/LocalAI

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-9900, inspect your project dependencies for Github.com/mudler/LocalAI:

inspect dependencies for github.com/mudler/LocalAI

Analyze the terminal output to locate any version of Github.com/mudler/LocalAI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.22.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-115: Misinterpretation of Input, where the product misinterprets an input, whether from an attacker or another product, in a security-relevant fashion. In Github.com/mudler/LocalAI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

mudler/localai version v2.21.1 contains a Cross-Site Scripting (XSS) vulnerability in its search functionality. The vulnerability arises due to improper sanitization of user input, allowing the injection and execution of arbitrary JavaScript code. This can lead to the execution of malicious scripts in the context of the victim's browser, potentially compromising user sessions, stealing session cookies, redirecting users to malicious websites, or manipulating the DOM.

CVE-2024-9900 Affected Github.com/mudler/LocalAI Versions

1 component(s)
Fixed Versions:
2.22.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/mudler/LocalAI
Go
< 2.22.0
2.22.0

References

Frequently Asked Questions

What is CVE-2024-9900?
CVE-2024-9900 is a security vulnerability in Github.com/mudler/LocalAI involving LocalAI Cross-Site Scripting (XSS) vulnerability in its search functionality under CWE-115: Misinterpretation of Input.
Which Github.com/mudler/LocalAI versions are affected?
Affected versions include releases prior to 2.22.0 across affected packages: github.com/mudler/LocalAI.
What version fixes CVE-2024-9900?
Upgrading to 2.22.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/mudler/LocalAI affected?
Yes, github.com/mudler/LocalAI is affected in releases prior to 2.22.0. Upgrade your dependency to 2.22.0 or later.
What is the CVSS score of CVE-2024-9900?
CVE-2024-9900 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2024-9900?
CVE-2024-9900 is classified under CWE-115: Misinterpretation of Input (The product misinterprets an input, whether from an attacker or another product, in a security-relevant fashion.).
How can I check Go dependencies for CVE-2024-9900?
Run the dependency tree command: 'inspect dependencies for github.com/mudler/LocalAI'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w6hh-w36c-vxmw",
  "modified" : "2025-03-21T03:39:11Z",
  "published" : "2025-03-20T12:32:51Z",
  "aliases" : [ "CVE-2024-9900" ],
  "summary" : "LocalAI Cross-Site Scripting (XSS) vulnerability in its search functionality",
  "details" : "mudler/localai version v2.21.1 contains a Cross-Site Scripting (XSS) vulnerability in its search functionality. The vulnerability arises due to improper sanitization of user input, allowing the injection and execution of arbitrary JavaScript code. This can lead to the execution of malicious scripts in the context of the victim's browser, potentially compromising user sessions, stealing session cookies, redirecting users to malicious websites, or manipulating the DOM.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/mudler/LocalAI"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.22.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-9900"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mudler/localai/commit/a1634b219a4e52813e70ff07e6376a01449c4515"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mudler/LocalAI"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/b39cd230-db66-471b-89b9-24afaa078e68"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-115", "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-21T03:39:10Z",
    "nvd_published_at" : "2025-03-20T10:15:50Z"
  }
}