CVE-2023-40024 Reflected Cross-Site Scripting (XSS) in scancode.io license endpoint

Medium 5.4 Published Updated

Attackers can inject malicious scripts via the license endpoint, leading to session hijacking or data theft for users of ScanCode.io.

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-2023-40024?

CVE-2023-40024 is a medium-severity cross-site scripting vulnerability in nexB scancode.io, published on 14 Aug 2023. 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

ScanCode.io is a server to script and automate software composition analysis pipelines. In the `/license/` endpoint, the detailed view key is not properly validated and sanitized, which can result in a potential cross-site scripting (XSS) vulnerability when attempting to access a detailed license view that does not exist. Attackers can exploit this vulnerability to inject malicious scripts into the response generated by the `license_details_view` function. When unsuspecting users visit the page, their browsers will execute the injected scripts, leading to unauthorized actions, session hijacking, or stealing sensitive information. This issue has been addressed in release `32.5.2`. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-79

Which versions are affected by CVE-2023-40024?

3 open source packages ship an affected version, including scancodeio. It affects 1 product.

PackageAffectedFixed in
scancodeio PyPIAll versions32.5.2
scancodeio PyPIAll versions32.5.2
scancodeio PyPIAll versions32.5.2

Products include Nexb Scancode.io.

How do I fix CVE-2023-40024?

Upgrade scancodeio to 32.5.2 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-2023-40024 being exploited?

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

Sources

Also known as GHSA-6xcx-gx7r-rccj, PYSEC-2026-1905.

Is CVE-2023-40024 in your software?

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

Check your SBOMs for free