4.3medium
tarteaucitron.js: data-cookie attribute can be used to delete arbitrary cookies
- Severity
- 4.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.20% (higher than 10% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-jxj7-g6gm-49j7DRUPAL-CONTRIB-2026-040
Description
tarteaucitron.js is a compliant and accessible cookie banner. Prior to 1.33.0, tarteaucitron.cookie.purge() is called on any element with the purgeBtn class and does not check whether the element is a legitimate tarteaucitron button or whether the cookie corresponds to a service handled by tarteaucitron. If an attacker can write HTML with data attributes, an element with data-cookie can silently delete a non-HttpOnly cookie with a known name when clicked by a user. This issue is fixed in version 1.33.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| AmauriC tarteaucitron.js | < 1.33.0 | CVE List |
| tarteaucitronjs (npm) | before 1.33.0 | GitHub Advisory Database |
| drupal/tacjs (Packagist:https://packages.drupal.org/8) | before 6.8.0 | Drupal Security Team |
All scores
| GitHub_M | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N |
| GitHub | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
tarteaucitron.js is a compliant and accessible cookie banner. Prior to 1.33.0, tarteaucitron.cookie.purge() is called on any element with the purgeBtn class and does not check whether the element is a legitimate tarteaucitron button or whether the cookie corresponds to a service handled by tarteaucitron. If an attacker can write HTML with data attributes, an element with data-cookie can silently delete a non-HttpOnly cookie with a known name when clicked by a user. This issue is fixed in version 1.33.0.
GitHub Advisory Database
Summary
tarteaucitron provides a list of cookies and buttons to delete them. If an attacker can write HTML with data attributes, they could create an element that silently deletes a cookie when clicked and trick a user to delete this cookie.
Details
tarteaucitron.cookie.purge() is called on any element with the purgeBtn class. It does not check if the element is a legitimate tarteaucitron button or if the cookie corresponds to a service handled by tarteaucitron.
PoC
<a class="purgeBtn" data-cookie="foo">Click me!</a>
If someone has a cookie with this name and clicks on the link, the cookie is silently deleted.
Impact
The impact is limited because this only works on cookies without HttpOnly=true and the attacker has to know the name of the cookie.
Drupal Security Team
This module enables sites to comply with the European cookie law using tarteaucitron.js.
The module doesn't sufficiently filter user-supplied markup inside of content leading to an attacker being able to delete arbitrary cookies.
This vulnerability is mitigated by the fact that an attacker needs to be able to insert specific data attributes in the page.
For additional information, see the Github Security Advisory GHSA-jxj7-g6gm-49j7 for the tarteaucitron.js library.
NVD (es)
tarteaucitron.js es un banner de cookies conforme y accesible. Antes de 1.33.0, tarteaucitron.cookie.purge() se llama en cualquier elemento con la clase purgeBtn y no verifica si el elemento es un botón legítimo de tarteaucitron o si la cookie corresponde a un servicio gestionado por tarteaucitron. Si un atacante puede escribir HTML con atributos de datos, un elemento con data-cookie puede eliminar silenciosamente una cookie no HttpOnly con un nombre conocido cuando un usuario hace clic en él. Este problema está solucionado en la versión 1.33.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-49977 changed 2026-07-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jxj7-g6gm-49j7 changed 2026-11-17 | CC-BY-4.0 |
| Drupal Security Team | DRUPAL-CONTRIB-2026-040 changed 2026-11-17 | MIT |
| NVD | CVE-2026-49977 changed 2026-10-24 | Public domain |