# CVE-2026-120644: CGI::Cookie cookie attribute injection via unvalidated path, domain, expires

Source: https://junglewise.ai/threats/cve-2026-120644-cgi-cookie-versions-before-5-00-for-perl-allow-cookie-attribute  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-04. Updated: 2026-11-04  
License: CC BY 4.0 with a link back

CVE-2026-120644 · Severity: info · Published 2026-11-04

CGI::Cookie is a Perl library used to manage HTTP cookies in web applications. Versions before 5.00 fail to validate the path, domain, and expires cookie attributes, allowing attackers to inject additional cookie attributes like SameSite or Domain if an application passes untrusted request data to these fields. This can lead to session hijacking, cross-site request forgery attacks, or other cookie-based security bypasses.

Vendors: [Perl](https://junglewise.ai/threats/vendors/perl).

## Quick answers

**Is CVE-2026-120644 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-120644 being exploited in the wild.

**How severe is CVE-2026-120644?** Informational severity, published 4 November 2026.

**Which products and versions are affected?** Perl CGI::Cookie before 5.00.

**Is there a fix for CVE-2026-120644?** Yes: fixed in 5.00. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-120644 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-120644?** Check whether you run Perl CGI::Cookie at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in 5.00

## Technical details

CGI::Cookie versions before 5.00 do not sanitize the path, domain, and expires attributes when constructing Set-Cookie headers, only escaping the name and value. An attacker can inject semicolons or control characters into these fields to add arbitrary cookie attributes (e.g., "/path; Domain=attacker.com"), particularly when an application passes user-controlled input like request path or query parameters directly to these methods. The vulnerability requires the application to pass untrusted data to the cookie constructor or attribute setters; the fix in version 5.00 validates these fields against RFC 6265 and rejects values containing semicolons, control characters, or (for domain) invalid hostnames.

## Affected products

- Perl CGI::Cookie before 5.00

## Timeline

- 2026-11-04: disclosed
- 2026-11-02: patched: Fix committed to GitHub

## References

- [https://cpan.org/modules](https://cpan.org/modules)
- [https://github.com/leejo/CGI.pm/commit/0b3527faaa9de55f79ca7d59dd3bcfb2c5540e00.patch](https://github.com/leejo/CGI.pm/commit/0b3527faaa9de55f79ca7d59dd3bcfb2c5540e00.patch)

## Related threats

- [Perl CGI::Cookie regex injection in expires parsing](https://junglewise.ai/threats/cve-2026-120631-cgi-cookie-versions-from-4-67-before-5-00-for-perl-allow-denial)
