# CVE-2025-31138: tarteaucitron.js CSS injection enabling UI manipulation

Source: https://junglewise.ai/threats/cve-2025-31138-tarteaucitron-js-css-injection-enabling-ui-manipulation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-04-07. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-31138 · Severity: low · CVSS 3.1 · Published 2025-04-07

tarteaucitron.js is a JavaScript library for managing cookies and user consent on websites. An attacker with admin access to the site or its CMS could inject malicious CSS values through width/height parameters to overlay fake interface elements, trick users into clicking hidden buttons (clickjacking), or disrupt the page layout—potentially compromising user trust or enabling credential theft.

Technologies: [tarteaucitronjs (npm)](https://junglewise.ai/threats/technologies/tarteaucitronjs). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

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

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

**Which products and versions are affected?** tarteaucitronjs (npm) SEMVER:introduced=0,fixed=1.20.1.

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

**How is CVE-2025-31138 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2025-31138?** Check whether you run 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.20.1 or later

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


## Technical details

The vulnerability is an improper restriction of rendered UI layers (CWE-1021) caused by inadequate validation of user-controlled CSS properties for element dimensions. An attacker with high privileges (code access or CMS control) can supply unvalidated width and height parameters containing CSS injection payloads such as "100%;height:100%;position:fixed;" to cover the viewport and facilitate clickjacking attacks. The vulnerability requires network access and high privilege level but no user interaction. The fix (commit 25fcf82) enforces strict validation and sanitization of CSS values. The vulnerability was patched in version 1.20.1 and affected all prior versions.

## Affected products

- Amauri Céjero tarteaucitron.js below 1.20.1

## Identifiers

- CVE-2025-31138
- GHSA-7524-3396-fqv3

## Timeline

- 2025-04-07: disclosed
- 2025-04-07: patched: version 1.20.1

## References

- [https://github.com/AmauriC/tarteaucitron.js/security/advisories/GHSA-7524-3396-fqv3](https://github.com/AmauriC/tarteaucitron.js/security/advisories/GHSA-7524-3396-fqv3)

## 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 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)
- [tarteaucitron.js URL scheme injection via unfiltered inputs](https://junglewise.ai/threats/cve-2025-31476-tarteaucitron-js-url-scheme-injection-via-unfiltered-inputs)
