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

Source: https://junglewise.ai/threats/cve-2025-48939-tarteaucitron-js-dom-clobbering-via-document-currentscript  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-07-03. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-48939 · Severity: low · CVSS 3.1 · Published 2025-07-03

tarteaucitron.js is a popular JavaScript library for managing cookie consent and third-party scripts on websites. An attacker who can inject HTML elements into a page could trick the library into loading scripts from an incorrect domain, potentially redirecting traffic to malicious CDNs and compromising the integrity of all scripts loaded by the library on that page.

Technologies: [AmauriC Tarteaucitron.Js](https://junglewise.ai/threats/technologies/tarteaucitron-js), [tarteaucitronjs (npm)](https://junglewise.ai/threats/technologies/tarteaucitronjs). Vendors: [AmauriC](https://junglewise.ai/threats/vendors/amauric), [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2025-48939 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-48939 being exploited in the wild.

**How severe is CVE-2025-48939?** Low severity, with a CVSS score of 3.1, published 3 July 2025.

**Which products and versions are affected?** AmauriC Tarteaucitron.Js before 1.22.0; tarteaucitronjs (npm) SEMVER:introduced=0,fixed=1.22.0.

**Is there a fix for CVE-2025-48939?** Yes. tarteaucitronjs (npm): upgrade to 1.22.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-48939 attacked?** It is attacked with local access or from the adjacent network, in a software library.

**Am I affected by CVE-2025-48939?** Check whether you run AmauriC Tarteaucitron.Js or tarteaucitronjs (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- tarteaucitronjs (npm): upgrade to 1.22.0 or later

  ```sh
  npm install tarteaucitronjs@1.22.0
  ```


## Technical details

The vulnerability is a DOM clobbering attack (CWE-138) where the library accesses document.currentScript without verifying it is an actual HTMLScriptElement. An attacker can inject a named HTML element (e.g., &lt;img name="currentScript"&gt;) which clobbers the document.currentScript property in some browser environments. This causes the script to resolve incorrectly, potentially allowing the attacker to change the CDN domain from which scripts are loaded. The attack requires local or adjacent network access, high privileges, and user interaction. A patch was released in version 1.22.0 that validates document.currentScript is an HTMLScriptElement instance and safely falls back to the last script tag if not.

## Affected products

- AmauriC tarteaucitron.js before 1.22.0

## Identifiers

- CVE-2025-48939
- GHSA-q43x-79jr-cq98

## Timeline

- 2025-07-03: disclosed
- 2025-07-03: patched: Version 1.22.0 released with fix (commit 230a3b6)

## References

- [https://github.com/AmauriC/tarteaucitron.js/security/advisories/GHSA-q43x-79jr-cq98](https://github.com/AmauriC/tarteaucitron.js/security/advisories/GHSA-q43x-79jr-cq98)

## Related threats

- [AmauriC tarteaucitron.js unauthorized cookie deletion via data-cookie attribute](https://junglewise.ai/threats/cve-2026-49977-amauric-tarteaucitron-js-unauthorized-cookie-deletion-via-data)
- [tarteaucitron.js Regular Expression Denial of Service](https://junglewise.ai/threats/cve-2026-22809-tarteaucitron-js-regular-expression-denial-of-service)
- [tarteaucitron.js prototype pollution in custom text injection](https://junglewise.ai/threats/cve-2025-31475-tarteaucitron-js-prototype-pollution-in-custom-text-injection)
- [tarteaucitron.js CSS injection enabling UI manipulation](https://junglewise.ai/threats/cve-2025-31138-tarteaucitron-js-css-injection-enabling-ui-manipulation)
- [tarteaucitron.js URL scheme injection via unfiltered inputs](https://junglewise.ai/threats/cve-2025-31476-tarteaucitron-js-url-scheme-injection-via-unfiltered-inputs)
