tinyproxy: patch CVE-2025-63938

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-63938

Pick the patch referenced by the nvd report.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Gyorgy Sarvari 2025-12-23 18:49:25 +01:00 committed by Khem Raj
parent 1a4dcfca3e
commit 7981f52062
No known key found for this signature in database
GPG Key ID: BB053355919D3314
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,43 @@
From cee659d2ac1e4e9d1ce388338f46df6c4bae8278 Mon Sep 17 00:00:00 2001
From: Gyorgy Sarvari <skandigraun@gmail.com>
Date: Fri, 17 Oct 2025 22:57:39 +0000
Subject: [PATCH] reqs: fix integer overflow in port number processing
From: rofl0r <rofl0r@users.noreply.github.com>
closes #586
CVE: CVE-2025-63938
Upstream-Status: Backport [https://github.com/tinyproxy/tinyproxy/commit/3c0fde94981b025271ffa1788ae425257841bf5a]
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
src/reqs.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/reqs.c b/src/reqs.c
index a65ed54..1e5895c 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -174,7 +174,7 @@ static int strip_return_port (char *host)
{
char *ptr1;
char *ptr2;
- int port;
+ unsigned port;
ptr1 = strrchr (host, ':');
if (ptr1 == NULL)
@@ -186,8 +186,11 @@ static int strip_return_port (char *host)
return 0;
*ptr1++ = '\0';
- if (sscanf (ptr1, "%d", &port) != 1) /* one conversion required */
- return 0;
+
+ port = atoi(ptr1);
+ /* check that port string is in the valid range 1-0xffff) */
+ if(strlen(ptr1) > 5 || (port & 0xffff0000)) return 0;
+
return port;
}

View File

@ -7,6 +7,7 @@ SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.gz
file://disable-documentation.patch \
file://tinyproxy.service \
file://tinyproxy.conf \
file://CVE-2025-63938.patch \
"
SRC_URI[sha256sum] = "2c8fe5496f2c642bfd189020504ab98d74b9edbafcdb94d9f108e157b5bdf96d"