5.5medium
tarteaucitron.js allows prototype pollution via custom text injection
- Severity
- 5.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.35% (higher than 30% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-4hwx-xcc5-2hfc
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| AmauriC tarteaucitron.js | < 1.20.1 | CVE List |
| tarteaucitronjs (npm) | before 1.20.1 | GitHub Advisory Database |
| amauri tarteaucitronjs | before 1.20.1 | NVD |
All scores
| GitHub_M | 5.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N |
| GitHub | 5.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N |
| NVD | 6.6medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:L |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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.
GitHub Advisory Database
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.
NVD (es)
tarteaucitron.js es un banner de cookies compatible y accesible. Se identificó una vulnerabilidad en tarteaucitron.js antes de la versión 1.20.1, donde la función addOrUpdate, utilizada para aplicar textos personalizados, no validaba correctamente la entrada. Esto permitía a un atacante con acceso directo al código fuente del sitio o a un complemento de CMS manipular prototipos de objetos JavaScript, lo que conllevaba posibles riesgos de seguridad, como corrupción de datos o ejecución de código no intencionada. Un atacante con privilegios elevados podría explotar esta vulnerabilidad para modificar prototipos de objetos, lo que afectaría el comportamiento principal de JavaScript, provocaría fallos en la aplicación o comportamientos inesperados, o incluso introduciría vulnerabilidades de seguridad adicionales según la arquitectura de la aplicación. Esta vulnerabilidad se corrigió en la versión 1.20.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-31475 changed 2025-04-07 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4hwx-xcc5-2hfc changed 2025-04-07 | CC-BY-4.0 |
| NVD | CVE-2025-31475 changed 2026-06-17 | Public domain |