tinyproxy: patch CVE-2026-54387

Backport commit identified by Debian[1]

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-54387

[1]https://security-tracker.debian.org/tracker/CVE-2026-54387

Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
This commit is contained in:
Ankur Tyagi
2026-09-15 10:13:33 +05:30
committed by Anuj Mittal
parent 985acd9e7c
commit 33649b0657
2 changed files with 38 additions and 0 deletions
@@ -0,0 +1,37 @@
From a9602e492cedd5d5d18dd3675d9be90e9b0d9e66 Mon Sep 17 00:00:00 2001
From: rofl0r <rofl0r@users.noreply.github.com>
Date: Thu, 7 May 2026 16:33:11 +0000
Subject: [PATCH] reqs: prevent request smuggling via both content-length and
chunked
addressing point 1 of #609
(cherry picked from commit 623bfc093df009296f0b85d40bc677ef9d5c09bb)
CVE: CVE-2026-54387
Upstream-Status: Backport [https://github.com/tinyproxy/tinyproxy/commit/623bfc093df009296f0b85d40bc677ef9d5c09bb]
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
src/reqs.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/reqs.c b/src/reqs.c
index 8b68538..e3cfe76 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -942,8 +942,13 @@ process_client_headers (struct conn_s *connptr, pseudomap *hashofheaders)
connptr->content_length.client = get_content_length (hashofheaders);
/* Check whether client sends chunked data. */
- if (connptr->content_length.client == -1 && is_chunked_transfer (hashofheaders))
+ if (is_chunked_transfer (hashofheaders)) {
+ if (connptr->content_length.client != -1)
+ /* request smuggling, see GH issue #609 */
+ pseudomap_remove (hashofheaders, "content-length");
+
connptr->content_length.client = -2;
+ }
/*
* See if there is a "Connection" header. If so, we need to do a bit
@@ -10,6 +10,7 @@ SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.gz
file://CVE-2026-3945-1.patch \
file://CVE-2026-3945-2.patch \
file://CVE-2026-31842.patch \
file://CVE-2026-54387.patch \
"
SRC_URI[sha256sum] = "9bcf46db1a2375ff3e3d27a41982f1efec4706cce8899ff9f33323a8218f7592"