Skip to contentSkip to conversation

tinyproxy: patch CVE-2025-63938

PATCH New Gyorgy Sarvari 1 participant 2 messages Dec 23, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tinyproxy: patch CVE-2025-63938

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

Pick the patch referenced by the nvd report.

---
 .../tinyproxy/tinyproxy/CVE-2025-63938.patch  | 43 +++++++++++++++++++
 .../tinyproxy/tinyproxy_1.11.2.bb             |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta-networking/recipes-support/tinyproxy/tinyproxy/CVE-2025-63938.patch
meta-networking/recipes-support/tinyproxy/tinyproxy/CVE-2025-63938.patch new file +43 -0
new file mode 100644
index 0000000000..e06e0d3eae
@@ -0,0 +1,43 @@
+From cee659d2ac1e4e9d1ce388338f46df6c4bae8278 Mon Sep 17 00:00:00 2001
+From: Gyorgy Sarvari <[email protected]>
+Date: Fri, 17 Oct 2025 22:57:39 +0000
+Subject: [PATCH] reqs: fix integer overflow in port number processing
+
+From: rofl0r <[email protected]>
+
+closes #586
+
+CVE: CVE-2025-63938
+Upstream-Status: Backport [https://github.com/tinyproxy/tinyproxy/commit/3c0fde94981b025271ffa1788ae425257841bf5a]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ 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;
+ }
+ 
meta-networking/recipes-support/tinyproxy/tinyproxy_1.11.2.bb +1 -0
index 5b8e9dcd7a..e386d39cdc 100644
@@ -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"
#1 lore raw

PATCH 2/2 tinyproxy: add ptest support

It takes <10s to execute.

Sample output:

root@qemux86-64:~# ptest-runner
START: ptest-runner
2025-12-23T17:45
BEGIN: /usr/lib/tinyproxy/ptest
starting web server... done (listening on 127.0.0.3:32123)
starting tinyproxy... done (listening on 127.0.0.2:12321)
waiting for 1 seconds.. done
checking direct connection to web server... ok
testing connection through tinyproxy... ok
requesting statspage via stathost url... ok
signaling tinyproxy to reload config...ok
checking direct connection to web server... ok
testing connection through tinyproxy... ok
requesting statspage via stathost url... ok
checking bogus request... ok, got expected error code 400
testing connection to filtered domain... ok, got expected error code 403
requesting connect method to denied port... ok, got expected error code 403
testing unavailable backend... ok, got expected error code 502
0 errors
killing tinyproxy... ok
killing webserver... ok
done
PASS: run_tests.sh
DURATION: 1
END: /usr/lib/tinyproxy/ptest
2025-12-23T17:45
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../ptest-packagelists-meta-networking.inc    |  1 +
 .../tinyproxy/tinyproxy/run-ptest             | 10 +++++++
 .../tinyproxy/tinyproxy_1.11.2.bb             | 26 ++++++++++++++++++-
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/tinyproxy/tinyproxy/run-ptest
meta-networking/conf/include/ptest-packagelists-meta-networking.inc +1 -0
index 838aee94d3..0897024e3c 100644
@@ -23,6 +23,7 @@ PTESTS_FAST_META_NETWORKING = "\
     python3-scapy \
     squid \
     tcpdump \
+    tinyproxy \
     wolfssl \
 "
 PTESTS_FAST_META_NETWORKING:remove:libc-musl = "\
meta-networking/recipes-support/tinyproxy/tinyproxy/run-ptest new file +10 -0
new file mode 100644
index 0000000000..267a975c24
@@ -0,0 +1,10 @@
+#!/bin/sh
+RET=0
+cd tests/scripts
+if ./run_tests.sh; then
+    echo PASS: run_tests.sh
+else
+    echo FAIL: run_tests.sh
+    RET=1
+fi
+exit $RET
meta-networking/recipes-support/tinyproxy/tinyproxy_1.11.2.bb +25 -1
index e386d39cdc..222cc8d7c6 100644
@@ -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://run-ptest \
            file://CVE-2025-63938.patch \
            "
 
@@ -22,7 +23,7 @@ EXTRA_OECONF += " \
 	--enable-xtinyproxy \
 	"
 
-inherit autotools systemd useradd
+inherit autotools systemd useradd ptest
 
 #User specific
 USERADD_PACKAGES = "${PN}"
@@ -40,3 +41,26 @@ do_install:append() {
 	fi
 	install -m 0644 ${UNPACKDIR}/tinyproxy.conf ${D}${sysconfdir}/tinyproxy.conf
 }
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/tests/scripts
+	install -d ${D}${PTEST_PATH}/data/templates
+	install ${S}/tests/scripts/*.sh ${D}${PTEST_PATH}/tests/scripts
+	install ${S}/tests/scripts/*.pl ${D}${PTEST_PATH}/tests/scripts
+	install -m 0644 ${S}/data/templates/*.html ${D}${PTEST_PATH}/data/templates/
+	# test the installed binary, not the one that was just compiled in the src folder
+	sed -i 's,TINYPROXY_BIN=.*,TINYPROXY_BIN=tinyproxy,' ${D}${PTEST_PATH}/tests/scripts/run_tests.sh
+}
+
+RDEPENDS:${PN}-ptest += "\
+    perl \
+    perl-module-cwd \
+    perl-module-encode-encoding \
+    perl-module-file-spec \
+    perl-module-getopt-long \
+    perl-module-io-socket \
+    perl-module-io-socket-inet \
+    perl-module-pod-text \
+    perl-module-posix \
+    procps \
+"