Skip to content
Fencer Vulns
high 7.5

CVE-2021-41819 json

Cookie Prefix Spoofing in CGI::Cookie.parse

published 2022-01-01 4 y ago modified 2026-09-08 2 mo ago also BIT-ruby-2021-41819 , BIT-ruby-min-2021-41819 , EUVD-2022-0449 , GHSA-4vf4-qmvg-mh7h , JLSEC-2026-1288

cvss
7.5
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
3.2%
EPSS 3.2% chance of exploitation in 30 days, percentile 88%
public exploits
0
none known

Summary

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.

Patch / fix

  • rubygems cgi 0.1.0.1, 0.2.1, 0.3.1
  • bitnami ruby 2.6.9, 2.7.5, 3.0.3
  • bitnami ruby-min 2.6.9, 2.7.5, 3.0.3
  • ruby-lang ruby 2.7.5, 3.0.3
  • ruby2.7 Debian 11 2.7.4-1+deb11u1

debian advisories DEBIAN-CVE-2021-41819

  • ruby2.5 Ubuntu 18.04 LTS 2.5.1-1ubuntu1.11
  • ruby2.7 Ubuntu 20.04 LTS 2.7.0-5ubuntu1.6
  • ruby3.0 Ubuntu 22.04 LTS 3.0.2-7ubuntu2
  • ruby2.3 Ubuntu Pro 16.04 LTS 2.3.1-2~ubuntu16.04.16+esm2

ubuntu advisories UBUNTU-CVE-2021-41819

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • ruby4.0 hummingbird 1 4.0.0-33.3.hum1
  • ruby4.0-libs hummingbird 1 4.0.0-33.3.hum1
  • ruby4.0-bundled-gems hummingbird 1 4.0.0-33.3.hum1
  • ruby4.0-default-gems hummingbird 1 4.0.0-33.3.hum1
  • ruby3.3 hummingbird 1 3.3.10-23.1.hum1
  • ruby3.3-libs hummingbird 1 3.3.10-23.1.hum1
  • ruby3.3-bundled-gems hummingbird 1 3.3.10-23.1.hum1
  • ruby3.3-default-gems hummingbird 1 3.3.10-23.1.hum1

red hat advisories RHSA-2026:8838RHSA-2026:7305RHSA-2026:7307RHSA-2022:0582RHSA-2022:0581RHSA-2022:6450

  • ruby2.5 SLE Module for Basesystem 15 SP4, SLE Module for Basesystem 15 SP3, openSUSE Leap 15.4 +1 more 2.5.9-150000.4.26.1

suse advisories SUSE-SU-2022:3292-1

  • ruby4.0 openSUSE Tumbleweed 4.0.0~preview2-1.1
  • ruby3.4 openSUSE Tumbleweed 3.4.1-1.1
  • ruby2.7 openSUSE Tumbleweed 2.7.5-1.1
  • ruby3.0 openSUSE Tumbleweed 3.0.3-1.1
  • ruby3.1 openSUSE Tumbleweed 3.1.0-1.1
  • ruby3.2 openSUSE Tumbleweed 3.2.1-1.1
  • ruby3.3 openSUSE Tumbleweed 3.3.0-1.2

opensuse advisories openSUSE-SU-2025:15819-1openSUSE-SU-2025:14621-1openSUSE-SU-2024:11657-1openSUSE-SU-2024:11658-1openSUSE-SU-2024:11786-1openSUSE-SU-2024:12712-1

  • ruby AlmaLinux 8 2.7.6-138.module_el8.6.0+3263+904da987
  • rubygems AlmaLinux 8 3.1.6-138.module_el8.6.0+3263+904da987
  • ruby-libs AlmaLinux 8 2.7.6-138.module_el8.6.0+3263+904da987
  • rubygem-pg AlmaLinux 8 1.2.3-1.module_el8.5.0+2595+0c654ebc
  • rubygem-pg AlmaLinux 8 1.2.3-1.module_el8.5.0+117+35d1289b
  • rubygem-pg AlmaLinux 8 1.2.3-1.module_el8.4.0+2399+4e3a532a
  • rubygem-pg AlmaLinux 8 1.2.3-1.module_el8.6.0+3167+957ef55e
  • rubygem-irb AlmaLinux 8 1.2.6-138.module_el8.6.0+3263+904da987

almalinux advisories ALSA-2022:6447ALSA-2022:6450ALSA-2022:5779ALSA-2022:0543

  • ruby Rocky Linux 8 3.0.4-141.module+el8.6.0+1002+a7dba0ac
  • rubygem-pg Rocky Linux 8 1.2.3-1.module+el8.5.0+668+665814fa
  • rubygem-pg Rocky Linux 8 1.2.3-1.module+el8.4.0+411+b946f28c
  • rubygem-pg Rocky Linux 8 1.2.3-1.module+el8.4.0+594+11b6673a
  • rubygem-abrt Rocky Linux 8 0.4.0-1.module+el8.5.0+668+665814fa
  • rubygem-abrt Rocky Linux 8 0.4.0-1.module+el8.4.0+411+b946f28c
  • rubygem-abrt Rocky Linux 8 0.4.0-1.module+el8.4.0+594+11b6673a
  • rubygem-mysql2 Rocky Linux 8 0.5.3-1.module+el8.5.0+668+665814fa

rocky linux advisories RLSA-2022:6450RLSA-2022:6447RLSA-2022:5779RLSA-2022:0543

  • ruby Alpine 3.14, Alpine 3.13, Alpine 3.12 2.7.5-r0
  • ruby Alpine 3.24, Alpine 3.23, Alpine 3.22 +7 more 3.0.3-r0

alpine advisories ALPINE-CVE-2021-41819

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • ruby CBL-Mariner 2.0 3.1.2-2

azure linux advisories AZL-7126

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

  • ruby Arch Linux 3.0.3-1

arch linux advisories AVG-2555

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-41819 updated cvss 7.5

ruby: Cookie prefix spoofing in CGI::Cookie.parse

  • Red Hat Enterprise Linux 6 ruby, ruby-ri, ruby-irb, ruby-libs, ruby-rdoc, ruby-tcltk Red Hat Enterprise Linux 7 ruby, ruby-irb, rubygems, ruby-libs, ruby-tcltk, rubygem-json, +6 more
    affected: no fix planned “Out of support scope”
  • Red Hat Enterprise Linux AppStream (v. 8) ruby 2.5.9-110.module+el8.6.0+15956+aa803fc1, ruby 2.6.9-108.module+el8.5.0+13719+08a8ba32, ruby 2.7.6-138.module+el8.6.0+16148+54b2ba8f, ruby 3.0.4-141.module+el8.6.0+16311+3e5e17e9, rubygem-pg 1.0.0-2.module+el8.1.0+3656+f80bfa1d, rubygem-pg 1.1.4-1.module+el8.1.0+3653+beb38eb0, +85 more
    fixed: vendor fix RHSA-2022:0543
  • Red Hat Enterprise Linux AppStream E4S (v. 8.1) ruby 2.6.9-107.module+el8.1.0+14088+04cf326e, rubygem-pg 1.1.4-1.module+el8.1.0+3653+beb38eb0, ruby-libs 2.6.9-107.module+el8.1.0+14088+04cf326e, rubygem-abrt 0.3.0-4.module+el8.1.0+3653+beb38eb0, rubygem-bson 4.5.0-1.module+el8.1.0+3653+beb38eb0, rubygem-mongo 2.8.0-1.module+el8.1.0+3653+beb38eb0, +17 more
    fixed: vendor fix RHSA-2022:0581
  • Red Hat Enterprise Linux AppStream EUS (v. 8.2) ruby 2.6.9-107.module+el8.2.0+14086+86d863af, rubygem-pg 1.1.4-1.module+el8.1.0+3653+beb38eb0, ruby-libs 2.6.9-107.module+el8.2.0+14086+86d863af, rubygem-abrt 0.3.0-4.module+el8.1.0+3653+beb38eb0, rubygem-bson 4.5.0-1.module+el8.1.0+3653+beb38eb0, rubygem-mongo 2.8.0-1.module+el8.1.0+3653+beb38eb0, +17 more
    fixed: vendor fix RHSA-2022:0582
  • Red Hat Enterprise Linux AppStream EUS (v.8.4) ruby 2.6.9-108.module+el8.4.0+14070+b3717926, rubygem-pg 1.1.4-1.module+el8.1.0+3653+beb38eb0, ruby-libs 2.6.9-108.module+el8.4.0+14070+b3717926, rubygem-abrt 0.3.0-4.module+el8.1.0+3653+beb38eb0, rubygem-bson 4.5.0-1.module+el8.1.0+3653+beb38eb0, rubygem-mongo 2.8.0-1.module+el8.1.0+3653+beb38eb0, +17 more
    fixed: vendor fix RHSA-2022:0544
  • Red Hat Hardened Images ruby3.4 3.4.8-31.1.hum1, ruby4.0 4.0.0-33.3.hum1, ruby3.3 3.3.10-23.1.hum1, ruby3.4-libs 3.4.8-31.1.hum1, ruby4.0-libs 4.0.0-33.3.hum1, ruby3.3-libs 3.3.10-23.1.hum1, +6 more
    fixed: vendor fix RHSA-2026:7305
  • Red Hat Software Collections for RHEL Workstation(v. 7) rh-ruby26-ruby 2.6.9-120.el7, rh-ruby27-ruby 2.7.6-131.el7, rh-ruby30-ruby 3.0.4-149.el7, rh-ruby27-rubygems 3.1.6-131.el7, rh-ruby26-ruby-libs 2.6.9-120.el7, rh-ruby27-ruby-libs 2.7.6-131.el7, +49 more Red Hat Software Collections for RHEL(v. 7) rh-ruby26-ruby 2.6.9-120.el7, rh-ruby27-ruby 2.7.6-131.el7, rh-ruby30-ruby 3.0.4-149.el7, rh-ruby27-rubygems 3.1.6-131.el7, rh-ruby26-ruby-libs 2.6.9-120.el7, rh-ruby27-ruby-libs 2.7.6-131.el7, +49 more
    fixed: vendor fix RHSA-2022:0708
  • Red Hat Enterprise Linux 9 ruby, rubygems, ruby-libs, rubygem-irb, rubygem-rbs, rubygem-rss, +13 more Red Hat Hardened Images rubygem3.3-rbs 3.4.0-23.1.hum1, rubygem3.3-rss 0.3.1-23.1.hum1, rubygem3.4-rbs 3.8.0-31.1.hum1, rubygem3.4-rss 0.3.1-31.1.hum1, rubygem4.0-rss 0.3.2-33.3.hum1, rubygem3.3-irb 1.13.1-23.1.hum1, +45 more
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
partial
Assessed
17 mo ago

Exploit prediction

3.15% chance of exploitation in the next 30 days, higher than 88% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • ruby-lang.org https://www.ruby-lang.org/en/news/2021/11/24/cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819/ referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CISA ADP 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHub 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CNA 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD 2.0 5.0 AV:N/AC:L/Au:N/C:N/I:P/A:N
OSV 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Affected packages

ecosystem package affected fixed in
rubygems cgi
>=0.3.0, <0.3.1
>=0.2.0, <0.2.1
<0.1.0.1
0.3.1
0.2.1
0.1.0.1
bitnami ruby
<2.6.9
>=2.7.0, <2.7.5
>=3.0.0, <3.0.3
2.6.9
2.7.5
3.0.3
bitnami ruby-min
<2.6.9
>=2.7.0, <2.7.5
>=3.0.0, <3.0.3
2.6.9
2.7.5
3.0.3
julia ruby_jll
all versions
no fix listed

Classification

Weakness
  • CWE-565 Reliance on Cookies without Validation and Integrity Checking

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.