# CVE-2025-31476: tarteaucitron.js URL scheme injection via unfiltered inputs

Source: https://junglewise.ai/threats/cve-2025-31476-tarteaucitron-js-url-scheme-injection-via-unfiltered-inputs  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-04-02. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-31476 · Severity: low · CVSS 3.1 · Published 2025-04-02

tarteaucitron.js is a JavaScript library that manages cookie consent and user preferences on websites. A vulnerability allows users with high privileges (CMS access, source code access) to inject malicious URLs containing JavaScript code (like javascript:alert()) that execute when other users click the links, potentially stealing data or modifying the site's behavior.

Technologies: [AmauriC Tarteaucitron.Js](https://junglewise.ai/threats/technologies/tarteaucitron-js), [tarteaucitronjs (npm)](https://junglewise.ai/threats/technologies/tarteaucitronjs), [Packagist:Https://Packages.Drupal.Org/8 Drupal/Tacjs](https://junglewise.ai/threats/technologies/drupal-tacjs). Vendors: [AmauriC](https://junglewise.ai/threats/vendors/amauric), [npm](https://junglewise.ai/threats/vendors/npm), [Packagist:Https://Packages.Drupal.Org/8](https://junglewise.ai/threats/vendors/packagist-https-packages-drupal-org-8).

## Quick answers

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

**How severe is CVE-2025-31476?** Low severity, with a CVSS score of 3.1, published 2 April 2025.

**Which products and versions are affected?** AmauriC Tarteaucitron.Js before 1.20.1; tarteaucitronjs (npm) SEMVER:introduced=0,fixed=1.20.1; Packagist:Https://Packages.Drupal.Org/8 Drupal/Tacjs ECOSYSTEM:introduced=0,fixed=6.7.0.

**Is there a fix for CVE-2025-31476?** Yes. tarteaucitronjs (npm): upgrade to 1.20.1 or later; Packagist:Https://Packages.Drupal.Org/8 Drupal/Tacjs: upgrade to 6.7.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-31476 attacked?** It is attacked over the network.

**Am I affected by CVE-2025-31476?** Check whether you run AmauriC Tarteaucitron.Js, tarteaucitronjs (npm) or Packagist:Https://Packages.Drupal.Org/8 Drupal/Tacjs 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.20.1 or later

  ```sh
  npm install tarteaucitronjs@1.20.1
  ```

- Packagist:Https://Packages.Drupal.Org/8 Drupal/Tacjs: upgrade to 6.7.0 or later

## Technical details

This is a cross-site scripting (CWE-79) vulnerability caused by insufficient URL validation in tarteaucitron.js. An attacker with high-level privileges can inject URLs with unsafe schemes (e.g., javascript:, data:) into the application; these URLs are not properly validated before being rendered in the web page. The attack requires both high privileges to insert the malicious URL and user interaction (clicking the link). When a victim clicks the injected link, arbitrary JavaScript executes in their browser context with access to the page. The vulnerability was fixed in version 1.20.1 by implementing strict URL validation that only allows http:// and https:// schemes.

## Affected products

- AmauriC tarteaucitron.js before 1.20.1

## Identifiers

- CVE-2025-31476
- DRUPAL-CONTRIB-2025-027
- GHSA-p5g4-v748-6fh8

## Timeline

- 2025-04-07: disclosed
- 2025-04-07: patched: Version 1.20.1 released with fix

## References

- [https://github.com/AmauriC/tarteaucitron.js/security/advisories/GHSA-p5g4-v748-6fh8](https://github.com/AmauriC/tarteaucitron.js/security/advisories/GHSA-p5g4-v748-6fh8)

## 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)
- [DRUPAL-CONTRIB-2026-040 - This module enables sites to comply with the European cookie law using tarteaucitron.js. The…](https://junglewise.ai/threats/drupal-contrib-2026-040-this-module-enables-sites-to-comply-with-the-9df41c5a)
- [tarteaucitron.js Regular Expression Denial of Service](https://junglewise.ai/threats/cve-2026-22809-tarteaucitron-js-regular-expression-denial-of-service)
- [tarteaucitron.js DOM Clobbering via document.currentScript](https://junglewise.ai/threats/cve-2025-48939-tarteaucitron-js-dom-clobbering-via-document-currentscript)
- [tarteaucitron.js prototype pollution in custom text injection](https://junglewise.ai/threats/cve-2025-31475-tarteaucitron-js-prototype-pollution-in-custom-text-injection)
