# CVE-2026-120631: Perl CGI::Cookie regex injection in expires parsing

Source: https://junglewise.ai/threats/cve-2026-120631-cgi-cookie-versions-from-4-67-before-5-00-for-perl-allow-denial  
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-120631 · Severity: info · Published 2026-11-04

Perl's CGI::Cookie module processes HTTP cookies received from clients. Versions 4.67 through 4.99 unsafely interpolate client-supplied cookie expiration values into regular expressions, allowing an attacker to craft malicious cookies that crash the application or cause severe performance degradation through catastrophic backtracking.

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

## Quick answers

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

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

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

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

**How is CVE-2026-120631 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-120631?** 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 CGI::Cookie 5.00 and later

## Technical details

CGI::Cookie::parse() interpolates the client-supplied "expires" cookie value unescaped into a regex substitution pattern, enabling regex injection. An attacker can supply specially crafted expires values—such as invalid regex syntax like '(' or pathological patterns like '(a|aa|aaa)*\1b'—to cause the process to die with a regex error or hang indefinitely from backtracking. The fix replaces the pattern-based removal with position-based string manipulation via substr().

## Affected products

- Perl CGI::Cookie 4.67 to before 5.00

## Timeline

- 2026-11-04: disclosed
- 2026-11-02: patched: Fix commit authored 2026-11-02

## References

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

## Related threats

- [CGI::Cookie cookie attribute injection via unvalidated path, domain, expires](https://junglewise.ai/threats/cve-2026-120644-cgi-cookie-versions-before-5-00-for-perl-allow-cookie-attribute)
