CVE-2023-40024 Reflected Cross-Site Scripting (XSS) in scancode.io license endpoint
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.
| Package | Affected | Fixed in |
|---|---|---|
scancodeio PyPI | All versions | 32.5.2 |
scancodeio PyPI | All versions | 32.5.2 |
scancodeio PyPI | All versions | 32.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.
Other vulnerabilities in nexB scancode.io
Sources
Also known as GHSA-6xcx-gx7r-rccj, PYSEC-2026-1905.