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.
Published: 2026-07-17
Score: 4.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The flaw in tarteaucitron.js prior to version 1.33.0 lies in the absence of a validation check in the tarteaucitron.cookie.purge() function when it is invoked on any element bearing the purgeBtn class. An attacker can supply an HTML element decorated with a data‑cookie attribute specifying the name of a non‑HttpOnly cookie that exists in the victim’s browser. When the user clicks that element, the library calls purge() without confirming that the cookie belongs to a legitimate tarteaucitron‑managed service, thereby silently deleting the indicated cookie. The description does not explicitly state that critical cookies such as sessions or tokens could be removed, but it is inferred that if such cookies are non‑HttpOnly a malicious click could terminate a user session or erase preferences stored in that cookie.

Affected Systems

Any website that integrates tarteaucitron.js by AmauriC before version 1.33.0 is impacted. All releases lacking the added validation on purgeBtn elements and the strict check of cookie names are vulnerable. Sites using the library for cookie compliance and preference management typically fall into this category unless they have manually removed or modified the purge logic.

Risk and Exploitability

With a CVSS score of 4.3 the vulnerability carries a moderate risk. The EPSS score of less than 1% indicates a low likelihood of exploitation in the wild. Attack requires the attacker to host a malicious page containing the crafted element and the victim to click it; the flaw only affects non‑HttpOnly cookies and is not listed in the CISA KEV catalog, suggesting no known public exploitation yet. If a session or authentication cookie is non‑HttpOnly, its removal could abruptly end the user’s session, an impact inferred from the potential effect of deleting arbitrary cookies.

Generated by OpenCVE AI on July 30, 2026 at 23:30 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade tarteaucitron.js to version 1.33.0 or newer so the purge function validates button legitimacy and cookie names.
  • Remove or protect custom HTML elements that use the purgeBtn class or data‑cookie attributes; ensure only legitimate tarteaucitron buttons invoke the purge logic.
  • Mark authentication and session cookies with the HttpOnly flag so they are immune to client‑side deletion by the purge mechanism.

Generated by OpenCVE AI on July 30, 2026 at 23:30 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-jxj7-g6gm-49j7 tarteaucitron: data-cookie attribute can be used to delete arbitrary cookies
History

Tue, 28 Jul 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Amauri
Amauri tarteaucitronjs
Vendors & Products Amauri
Amauri tarteaucitronjs

Mon, 20 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 17 Jul 2026 20:45:00 +0000

Type Values Removed Values Added
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.
Title tarteaucitron.js: data-cookie attribute can be used to delete arbitrary cookies
Weaknesses CWE-285
References
Metrics cvssV3_1

{'score': 4.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N'}


Subscriptions

Amauri Tarteaucitronjs
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-20T19:11:28.659Z

Reserved: 2026-06-02T18:30:51.281Z

Link: CVE-2026-49977

cve-icon Vulnrichment

Updated: 2026-07-17T20:23:26.752Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-30T23:30:08Z

Weaknesses