CVE-2025-31475
JSON

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 packageVersionsReported by
AmauriC tarteaucitron.js< 1.20.1CVE List
tarteaucitronjs (npm)before 1.20.1GitHub Advisory Database
amauri tarteaucitronjsbefore 1.20.1NVD

All scores

GitHub_M5.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N
GitHub5.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N
NVD6.6medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:L

Classification

CWE-1321

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

SourceRecordLicence
CVE ListCVE-2025-31475 changed 2025-04-07CVE Terms of Use
GitHub Advisory DatabaseGHSA-4hwx-xcc5-2hfc changed 2025-04-07CC-BY-4.0
NVDCVE-2025-31475 changed 2026-06-17Public domain