Skip to content
XSS Disclosed report Beginner CVE-2024-9900

LocalAI Cross-Site Scripting (XSS) vulnerability in its search functionality

The search functionality in LocalAI v2.21.1 does not properly sanitise user input, allowing an attacker to inject and execute arbitrary JavaScript. This could let an attacker run malicious scripts in a victim's browser, potentially compromising sessions, stealing cookies, redirecting users, or manipulating the page.

mudler/localai

Originally disclosed on huntr

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.

From the GitHub Advisory Database (GHSA-w6hh-w36c-vxmw, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the search input is reflected into the page without proper output encoding or sanitisation, so browser-executable markup is rendered.

Impact

An attacker could execute malicious scripts in the victim's browser, potentially compromising user sessions, stealing session cookies, redirecting users to malicious websites, or manipulating the DOM.

What the attacker needed

Victim uses the search feature; attacker can supply search input

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you type something into a search box, the website should treat it as plain text, not as code. Here, the search feature failed to do that, so someone could type in code that the browser then runs. That lets an attacker do things in your browser as if they were you, like reading your cookies or sending you to another site.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from mudler/localai

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.