CVE-2025-31138: tarteaucitron.js allows UI manipulation via unrestricted CSS injection

Published Apr 7, 2025
·
Updated

A vulnerability was identified in tarteaucitron.js, where user-controlled inputs for element dimensions (width and height) were not properly validated. This allowed an attacker with direct access to the site's source code or a CMS plugin to set values like 100%;height:100%;position:fixed;, potentially covering the entire viewport and facilitating clickjacking attacks.

Impact An attacker with high privileges could exploit this vulnerability to: - Overlay malicious UI elements on top of legitimate content, - Trick users into interacting with hidden elements (clickjacking), - Disrupt the intended functionality and accessibility of the website.

Fix https://github.com/AmauriC/tarteaucitron.js/commit/25fcf828aaa55306ddc09cfbac9a6f8f126e2d07 The issue was resolved by enforcing strict validation and sanitization of user-provided CSS values to prevent unintended UI manipulation.

Other sources

tarteaucitron.js is a compliant and accessible cookie banner. A vulnerability was identified in tarteaucitron.js prior to 1.20.1, where user-controlled inputs for element dimensions (width and height) were not properly validated. This allowed an attacker with direct access to the site's source code or a CMS plugin to set values like 100%;height:100%;position:fixed;, potentially covering the entire viewport and facilitating clickjacking attacks. An attacker with high privileges could exploit this vulnerability to overlay malicious UI elements on top of legitimate content, trick users into interacting with hidden elements (clickjacking), or disrupt the intended functionality and accessibility of the website. This vulnerability is fixed in 1.20.1.

— MITRE

Affected Software

3 affected componentsFixes available
tarteaucitron tarteaucitron.js<1.20.1
npm/tarteaucitronjs<1.20.1
1.20.1
Amauri Tarteaucitronjs Node.js<1.20.1

Event History

Apr 7, 2025
CVE Published
via MITRE·02:44 PM
Data Sourced
via MITRE·02:44 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:15 PM
RemedyAffected Software
Advisory Published
via GitHub·04:38 PM

Frequently Asked Questions

1

What is the severity of CVE-2025-31138?

CVE-2025-31138 has been classified as a high severity vulnerability due to improper validation of user-controlled input.

2

How do I fix CVE-2025-31138?

To fix CVE-2025-31138, update tarteaucitron.js to version 1.20.1 or higher.

3

What impact does CVE-2025-31138 have on affected systems?

CVE-2025-31138 could allow attackers to manipulate element dimensions, leading to potential security issues in web applications.

4

Which versions of tarteaucitron.js are affected by CVE-2025-31138?

CVE-2025-31138 affects all versions of tarteaucitron.js prior to version 1.20.1.

5

How can I ensure my application is safe from CVE-2025-31138?

To ensure safety from CVE-2025-31138, implement the latest version of tarteaucitron.js and validate user inputs thoroughly.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203