{"id":"CVE-2023-40024","aliases":["CVE-2023-40024","GHSA-6xcx-gx7r-rccj","PYSEC-2026-1905"],"related":[],"kind":"vulnerability","state":"published","title":"Reflected Cross-Site Scripting (XSS) in scancode.io license endpoint","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nIn 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.\n\n### Details\nIn the `/license/` endpoint, the `license_details_view` function is vulnerable to a potential cross-site scripting (XSS) attack due to inadequate validation and sanitization of the `key` parameter. This vulnerability arises when attempting to access a key with malicious javascript.\n\n```python\ndef license_details_view(request, key):\n    \"\"\"\n    Display all available information about a given license `key` followed by\n    the full license text.\n    \"\"\"\n    licenses = get_licenses()\n    try:\n        data = saneyaml.dump(licenses[key].to_dict())\n        text = licenses[key].text\n    except KeyError:\n        return HttpResponseNotFound(f\"License {key} not found.\") # Leads to cross-site scripting when key is malicious javascript\n    return HttpResponse(f\"<pre>{data}</pre><hr><pre>{text}</pre>\")\n```\n\n\n### PoC\n1. Access following endpoint on scancode.io instance: http://localhost/license/%3Cscript%3Ealert(document.cookie);%3C/script%3E/\n\n### Impact\nAttackers can exploit the 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.","format":"markdown","source":"ghsa"}],"published":"2023-08-14T19:53:24.808Z","modified":"2026-09-10T03:49:57.536Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 32.5.2","status":"affected"}],"vendor":"nexB","product":"scancode.io","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"32.5.2","status":"affected"}],"vendor":"nexb","product":"scancode.io","cpe":"cpe:2.3:a:nexb:scancode.io:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"32.5.2"}],"ecosystem":"PyPI","package":"scancodeio","purl":"pkg:pypi/scancodeio","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"32.5.1"}],"vendor":"nexb","product":"scancode.io","cpe":"cpe:2.3:a:nexb:scancode.io:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"32.5.2"}],"ecosystem":"PyPI","package":"scancodeio","purl":"pkg:pypi/scancodeio","source":"pysec"}],"references":[{"url":"https://github.com/nexB/scancode.io/security/advisories/GHSA-6xcx-gx7r-rccj","tags":["exploit","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nexB/scancode.io/blob/dd7769fbc97c84545579cebf1dc4838214098a11/CHANGELOG.rst#v3252-2023-08-14","tags":["release-notes","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-40024","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/nexB/scancode.io","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/nexB/scancode.io/releases/tag/v32.5.2","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/scancodeio","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-6xcx-gx7r-rccj","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-10-02T20:29:40.786Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-40024","url":"https://www.cve.org/CVERecord?id=CVE-2023-40024","licence":"CVE Terms of Use","modified":"2024-10-02T20:36:40.644Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6xcx-gx7r-rccj","url":"https://github.com/advisories/GHSA-6xcx-gx7r-rccj","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:57.536Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-40024","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-40024","licence":"Public domain","modified":"2026-06-17T06:15:48.160Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1905","url":"https://osv.dev/vulnerability/PYSEC-2026-1905","licence":"CC-BY-4.0","modified":"2026-07-07T17:47:51.792Z"}],"updatedAt":"2026-11-25T22:58:27.114Z","epss":{"score":0.00506,"percentile":0.44771,"date":"2026-12-01T12:00:22.000Z"}}