public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jan Macku <jamacku@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/curl] f44: Resolves: CVE-2026-80255 - secure cookie attribute bypass with tab
Date: Tue, 06 Oct 2026 12:30:09 GMT	[thread overview]
Message-ID: <179128980917.1.15894879673008223617.rpms-curl-e4acd1bb6c56@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/curl
Branch : f44
Commit : e4acd1bb6c56caf06627bb3699564e3902ce9f95
Author : Jan Macku <jamacku@redhat.com>
Date   : 2026-10-06T13:06:29+02:00
Stats  : +135/-0 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/curl/c/e4acd1bb6c56caf06627bb3699564e3902ce9f95?branch=f44

Log:
Resolves: CVE-2026-80255 - secure cookie attribute bypass with tab

---
diff --git a/0027-curl-8.18.0-CVE-2026-80255.patch b/0027-curl-8.18.0-CVE-2026-80255.patch
new file mode 100644
index 0000000..0adf466
--- /dev/null
+++ b/0027-curl-8.18.0-CVE-2026-80255.patch
@@ -0,0 +1,135 @@
+From 910fcaf795c37976e3bed67402c1674cff5a620b Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Thu, 27 Aug 2026 08:33:30 +0200
+Subject: [PATCH] cookie: improve TAB handling
+
+For entries with a leading tab. Verified in test 2885.
+
+Also stop exempting TAB from invalid_octets(), so cookies with a TAB
+in the name or value are properly rejected. This makes the separate
+memchr TAB check redundant.
+
+Reported-by: Stanislav Fort
+Closes #22699
+
+(cherry picked from commit 4f6aa41a0145e930e766775dbe860883d350aa0a)
+(cherry picked from commit 67300814294ab0aa311b8568b460619ecc522949)
+---
+ lib/cookie.c           | 13 ++++---------
+ tests/data/Makefile.am |  2 +-
+ tests/data/test2885    | 52 ++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 57 insertions(+), 10 deletions(-)
+ create mode 100644 tests/data/test2885
+
+diff --git a/lib/cookie.c b/lib/cookie.c
+index 38edf4a860..d7f3b2e1a4 100644
+--- a/lib/cookie.c
++++ b/lib/cookie.c
+@@ -355,9 +355,9 @@ static bool bad_domain(const char *domain, size_t len)
+ static bool invalid_octets(const char *ptr, size_t len)
+ {
+   const unsigned char *p = (const unsigned char *)ptr;
+-  /* Reject all bytes \x01 - \x1f (*except* \x09, TAB) + \x7f */
++  /* Reject all bytes \x01 - \x1f + \x7f */
+   while(len && *p) {
+-    if(((*p != 9) && (*p < 0x20)) || (*p == 0x7f))
++    if((*p < 0x20) || (*p == 0x7f))
+       return TRUE;
+     p++;
+     len--;
+@@ -455,7 +455,7 @@ parse_cookie_header(struct Curl_easy *data,
+     struct Curl_str val;
+ 
+     /* we have a <name>=<value> pair or a stand-alone word here */
+-    if(!curlx_str_cspn(&ptr, &name, ";\t\r\n=")) {
++    if(!curlx_str_cspn(&ptr, &name, ";\r\n=")) {
+       bool sep = FALSE;
+       curlx_str_trimblanks(&name);
+ 
+@@ -493,12 +493,7 @@ parse_cookie_header(struct Curl_easy *data,
+           return CURLE_OK;
+         }
+ 
+-        /* Reject cookies with a TAB inside the value */
+-        if(curlx_strlen(&val) &&
+-           memchr(curlx_str(&val), '\t', curlx_strlen(&val))) {
+-          infof(data, "cookie contains TAB, dropping");
+-          return CURLE_OK;
+-        }
++        /* TAB is now rejected by invalid_octets() above */
+ 
+         /* Check if we have a reserved prefix set. */
+         if(!strncmp("__Secure-", curlx_str(&name), 9))
+diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
+index 84ed10b3cf..8b448cfcca 100644
+--- a/tests/data/Makefile.am
++++ b/tests/data/Makefile.am
+@@ -275,7 +275,7 @@ test2600 test2601 test2602 test2603 test2604 test2605 \
+ test2700 test2701 test2702 test2703 test2704 test2705 test2706 test2707 \
+ test2708 test2709 test2710 test2711 test2712 test2713 test2714 test2715 \
+ test2716 test2717 test2718 test2719 test2720 test2721 test2722 test2723 \
+-\
++test2885 \
+ test3000 test3001 test3002 test3003 test3004 test3005 test3006 test3007 \
+ test3008 test3009 test3010 test3011 test3012 test3013 test3014 test3015 \
+ test3016 test3017 test3018 test3019 test3020 test3021 test3022 test3023 \
+diff --git a/tests/data/test2885 b/tests/data/test2885
+new file mode 100644
+index 0000000000..456224fdc5
+--- /dev/null
++++ b/tests/data/test2885
+@@ -0,0 +1,52 @@
++<?xml version="1.0" encoding="US-ASCII"?>
++<testcase>
++<info>
++<keywords>
++HTTP
++cookies
++</keywords>
++</info>
++
++<reply>
++<data crlf="headers">
++HTTP/1.1 200 OK
++Content-Length: 0
++Set-Cookie: thisis=SECRET;%TABSecure
++Set-Cookie: also=notab; Secure
++
++</data>
++</reply>
++
++<client>
++<features>
++cookies
++</features>
++<server>
++https
++</server>
++<name>
++Cookies with TAB before 'secure'
++</name>
++<command>
++https://cookie.example:%HTTPSPORT/%TESTNUMBER -c %LOGDIR/cookies.txt --resolve cookie.example:%HTTPSPORT:%HOSTIP --insecure
++</command>
++</client>
++
++<verify>
++<protocol crlf="headers">
++GET /%TESTNUMBER HTTP/1.1
++Host: cookie.example:%HTTPSPORT
++User-Agent: curl/%VERSION
++Accept: */*
++
++</protocol>
++<file name="%LOGDIR/cookies.txt" mode="text">
++# Netscape HTTP Cookie File
++# https://curl.se/docs/http-cookies.html
++# This file was generated by libcurl! Edit at your own risk.
++
++cookie.example%TABFALSE%TAB/%TABTRUE%TAB0%TABalso%TABnotab
++cookie.example%TABFALSE%TAB/%TABTRUE%TAB0%TABthisis%TABSECRET
++</file>
++</verify>
++</testcase>
+-- 
+2.55.0

                 reply	other threads:[~2026-10-06 12:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179128980917.1.15894879673008223617.rpms-curl-e4acd1bb6c56@fedoraproject.org \
    --to=jamacku@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox