CVE-2025-31475: tarteaucitron.js allows prototype pollution via custom text injection

Published Apr 7, 2025
·
Updated

A vulnerability was identified in tarteaucitron.js, where the addOrUpdate function, used for applying custom texts, did not properly validate input. This allowed an attacker with direct access to the site's source code or a CMS plugin to manipulate JavaScript object prototypes, leading to potential security risks such as data corruption or unintended code execution.

Impact An attacker with high privileges could exploit this vulnerability to: - Modify object prototypes, affecting core JavaScript behavior, - Cause application crashes or unexpected behavior, - Potentially introduce further security vulnerabilities depending on the application's architecture.

Fix https://github.com/AmauriC/tarteaucitron.js/commit/74c354c413ee3f82dff97a15a0a43942887c2b5b The issue was resolved by ensuring that user-controlled inputs cannot modify JavaScript object prototypes.

Other sources

tarteaucitron.js is a compliant and accessible cookie banner. A vulnerability was identified in tarteaucitron.js prior to 1.20.1, where the addOrUpdate function, used for applying custom texts, did not properly validate input. This allowed an attacker with direct access to the site's source code or a CMS plugin to manipulate JavaScript object prototypes, leading to potential security risks such as data corruption or unintended code execution. An attacker with high privileges could exploit this vulnerability to modify object prototypes, affecting core JavaScript behavior, cause application crashes or unexpected behavior, or potentially introduce further security vulnerabilities depending on the application's architecture. 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:48 PM
Data Sourced
via MITRE·02:48 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-31475?

CVE-2025-31475 has been classified as a medium severity vulnerability due to improper input validation.

2

How do I fix CVE-2025-31475?

To fix CVE-2025-31475, upgrade tarteaucitron.js to version 1.20.1 or later.

3

Who is affected by CVE-2025-31475?

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

4

What functionality does the addOrUpdate function in CVE-2025-31475 provide?

The addOrUpdate function in tarteaucitron.js is used for applying custom texts to the cookie banner.

5

What types of attacks could exploit CVE-2025-31475?

CVE-2025-31475 could allow attackers with direct access to a site's scripts to execute unvalidated input, leading to potential security breaches.

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