Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. tarteaucitronjs
  4. ›
  5. CVE-2025-48939

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

July 3, 2025

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 such as:

<img name="currentScript" src="https://malicious.example.com">

it could clobber the document.currentScript property. This causes the script to resolve incorrectly to an element instead of the tag, leading to unexpected behavior or failure to load the script path correctly.

This issue arises because in some browser environments, named DOM elements (e.g., name=“currentScript”) become properties on the global document object.

References

  • github.com/AmauriC/tarteaucitron.js
  • github.com/AmauriC/tarteaucitron.js/commit/230a3b69d363837acfa895823d841e0608826ba3
  • github.com/AmauriC/tarteaucitron.js/security/advisories/GHSA-q43x-79jr-cq98
  • github.com/advisories/GHSA-q43x-79jr-cq98
  • nvd.nist.gov/vuln/detail/CVE-2025-48939

Code Behaviors & Features

Detect and mitigate CVE-2025-48939 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.22.0

Fixed versions

  • 1.22.0

Solution

Upgrade to version 1.22.0 or above.

Impact 4.2 MEDIUM

CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:N/I:L/A:L

Learn more about CVSS

Weakness

  • CWE-138: Improper Neutralization of Special Elements

Source file

npm/tarteaucitronjs/CVE-2025-48939.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 19 Aug 2025 12:19:50 +0000.