CVE-2024-9900 Cross-Site Scripting (XSS) in mudler/localai

Medium 5.4 Published Updated

Attackers can inject malicious JavaScript via search input in LocalAI, potentially stealing session cookies or hijacking user sessions.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-9900?

CVE-2024-9900 is a medium-severity cross-site scripting vulnerability in mudler/localai, published on 20 Mar 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-79

Which versions are affected by CVE-2024-9900?

3 open source packages ship an affected version, including github.com/mudler/LocalAI. It affects 1 product.

PackageAffectedFixed in
github.com/mudler/LocalAI GoAll versionsNone
github.com/mudler/LocalAI GoAll versions2.22.0
github.com/mudler/LocalAI GoAll versions2.22.0

Products include Mudler Localai.

How do I fix CVE-2024-9900?

Upgrade github.com/mudler/LocalAI to 2.22.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2024-9900 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-9900 exists.

Sources

Also known as GHSA-w6hh-w36c-vxmw, GO-2025-3542.

Is CVE-2024-9900 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free