Skip to contentSkip to conversation

poco: patch CVE-2025-6375

PATCH New Peter Marko 1 participant 3 messages Jul 13, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 poco: patch CVE-2025-6375

From: Peter Marko <[email protected]>

Pick commit mentioned in [1].

[1] https://nvd.nist.gov/vuln/detail/CVE-2025-6375

---
 .../poco/poco/CVE-2025-6375.patch             | 34 +++++++++++++++++++
 meta-oe/recipes-support/poco/poco_1.11.2.bb   |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta-oe/recipes-support/poco/poco/CVE-2025-6375.patch
meta-oe/recipes-support/poco/poco/CVE-2025-6375.patch new file +34 -0
new file mode 100644
index 0000000000..2ec8f819f9
@@ -0,0 +1,34 @@
+From 6f2f85913c191ab9ddfb8fae781f5d66afccf3bf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= <[email protected]>
+Date: Wed, 16 Apr 2025 09:15:33 +0200
+Subject: [PATCH] fix(Net): A SEGV at Net/src/MultipartReader.cpp:164:1 #4915
+ (move assertion out of ctor)
+
+CVE: CVE-2025-6375
+Upstream-Status: Backport [https://github.com/pocoproject/poco/commit/6f2f85913c191ab9ddfb8fae781f5d66afccf3bf]
+Signed-off-by: Peter Marko <[email protected]>
+---
+ Net/src/MultipartReader.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Net/src/MultipartReader.cpp b/Net/src/MultipartReader.cpp
+index f3a2f2bba..f4aa27dd8 100644
+--- a/Net/src/MultipartReader.cpp
++++ b/Net/src/MultipartReader.cpp
+@@ -36,7 +36,6 @@ MultipartStreamBuf::MultipartStreamBuf(std::istream& istr, const std::string& bo
+ 	_boundary(boundary),
+ 	_lastPart(false)
+ {
+-	poco_assert (!boundary.empty() && boundary.length() < STREAM_BUFFER_SIZE - 6);
+ }
+ 
+ 
+@@ -47,7 +46,7 @@ MultipartStreamBuf::~MultipartStreamBuf()
+ 
+ int MultipartStreamBuf::readFromDevice(char* buffer, std::streamsize length)
+ {
+-	poco_assert_dbg (length >= _boundary.length() + 6);
++	poco_assert (!_boundary.empty() && _boundary.length() < length - 6);
+ 
+ 	static const int eof = std::char_traits<char>::eof();
+ 	std::streambuf& buf = *_istr.rdbuf();
meta-oe/recipes-support/poco/poco_1.11.2.bb +1 -0
index ae8bbf87e4..075eb72a06 100644
@@ -11,6 +11,7 @@ DEPENDS = "libpcre zlib"
 SRC_URI = " \
     git://github.com/pocoproject/poco.git;branch=main;protocol=https \
     file://run-ptest \
+    file://CVE-2025-6375.patch \
    "
 SRCREV = "9d1c428c861f2e5ccf09149bbe8d2149720c5896"
 
#1 lore raw

PATCH 2/3 poco: Remove pushd/popd from run-ptest

From: Khem Raj <[email protected]>

This could be worked out without needing to add bash dependency

---
 meta-oe/recipes-support/poco/poco/run-ptest | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta-oe/recipes-support/poco/poco/run-ptest +2 -3
index c479f7ac10..c9896eadee 100644
@@ -1,9 +1,8 @@
 #!/bin/sh
 while read runner; do
-  pushd . >/dev/null
+  oldpath=`pwd` >/dev/null
   cd bin
   echo Testing $runner
   ./$runner-testrunner -all
-  popd >/dev/null
+  cd $oldpath >/dev/null
 done < testrunners
-
#2 lore raw

PATCH 3/3 poco: Fix ptests

In reply to Peter Marko

From: Khem Raj <[email protected]>

testrunners file was coming out to be empty after anon python was turned into a prepend to populate_packages which is executed during do_package and hence POCO_TESTRUNNERS was not populated when it was used during do_ptest_install now. Therefore alter the logic to collect the list of tests to run into testrunners file. Also package the ignore file which is platform specific, here the lnx version is packaged and specified using -ignore cmd to tests

---
 meta-oe/recipes-support/poco/poco/run-ptest | 2 +-
 meta-oe/recipes-support/poco/poco_1.11.2.bb | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
meta-oe/recipes-support/poco/poco/run-ptest +1 -1
index c9896eadee..521cc08a75 100644
@@ -3,6 +3,6 @@ while read runner; do
   oldpath=`pwd` >/dev/null
   cd bin
   echo Testing $runner
-  ./$runner-testrunner -all
+  ./$runner -ignore $oldpath/cppignore.lnx -all
   cd $oldpath >/dev/null
 done < testrunners
meta-oe/recipes-support/poco/poco_1.11.2.bb +5 -4
index 075eb72a06..4711c6bb92 100644
@@ -66,17 +66,14 @@ python populate_packages:prepend () {
     poco_libdir = d.expand('${libdir}')
     pn = d.getVar("PN")
     packages = []
-    testrunners = []
 
     def hook(f, pkg, file_regex, output_pattern, modulename):
         packages.append(pkg)
-        testrunners.append(modulename)
 
     do_split_packages(d, poco_libdir, r'^libPoco(.*)\.so\..*$',
                     'poco-%s', 'Poco %s component', extra_depends='', prepend=True, hook=hook)
 
     d.setVar("RRECOMMENDS:%s" % pn, " ".join(packages))
-    d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
 }
 
 do_install_ptest () {
@@ -84,7 +81,11 @@ do_install_ptest () {
        cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
        cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
        find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
-       echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
+       rm -f ${D}${PTEST_PATH}/testrunners
+       for f in ${D}${PTEST_PATH}/bin/*-testrunner; do
+            echo `basename $f` >> ${D}${PTEST_PATH}/testrunners
+       done
+       install -Dm 0644 ${S}/cppignore.lnx ${D}${PTEST_PATH}/cppignore.lnx
 }
 
 PACKAGES_DYNAMIC = "poco-.*"