diff --git a/backport-0001-CVE-2021-33621.patch b/backport-0001-CVE-2021-33621.patch new file mode 100644 index 0000000000000000000000000000000000000000..1c29e0674cf168959b640b02ee3764deaa643f71 --- /dev/null +++ b/backport-0001-CVE-2021-33621.patch @@ -0,0 +1,169 @@ +From 30107a4797f14227568913499a9a0bb4285de63b Mon Sep 17 00:00:00 2001 +From: Nobuyoshi Nakada +Date: Tue, 16 Aug 2022 18:36:12 +0900 +Subject: [PATCH] Check cookie name/path/domain characters + +https://hackerone.com/reports/1204977 +--- + lib/cgi/cookie.rb | 44 ++++++++++++++++++++----- + test/cgi/test_cgi_cookie.rb | 64 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 100 insertions(+), 8 deletions(-) + +diff --git a/lib/cgi/cookie.rb b/lib/cgi/cookie.rb +index 6b0d89c..4b11a6a 100644 +--- a/lib/cgi/cookie.rb ++++ b/lib/cgi/cookie.rb +@@ -40,6 +40,10 @@ class CGI + class Cookie < Array + @@accept_charset="UTF-8" unless defined?(@@accept_charset) + ++ TOKEN_RE = %r"\A[[!-~]&&[^()<>@,;:\\\"/?=\[\]{}]]+\z" ++ PATH_VALUE_RE = %r"\A[[ -~]&&[^;]]*\z" ++ DOMAIN_VALUE_RE = %r"\A(?