Junglewise Threat Intelligence

CVE-2025-31476: DRUPAL-CONTRIB-2025-027 - This module enables sites to comply with the European cookie law using tarteaucitron.js. The module doesn't sufficiently filter user-suppli

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

Technologies: AmauriC Tarteaucitron.Js, Packagist:Https://Packages.Drupal.Org/8 Drupal/Tacjs, tarteaucitronjs (npm). Vendors: AmauriC, Packagist:Https://Packages.Drupal.Org/8, npm.

Executive brief

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.

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

Timeline

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

References

Related threats