[packages/php/PHP_5_3] Rel 75. Read the openssl_sign() result before freeing it

arekm arekm at pld-linux.org
Thu Nov 19 23:20:54 CET 2026


commit 3a719788c351bb4550981eaa84fd8e5409386b9f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Nov 19 20:56:09 2026 +0100

    Rel 75. Read the openssl_sign() result before freeing it
    
    OpenSSL signed phar archives fell back to SHA-1 at random, because
    phar read the result of openssl_sign() from freed memory.

 php-phar-openssl-sign-uaf.patch | 22 ++++++++++++++++++++++
 php.spec                        |  4 +++-
 2 files changed, 25 insertions(+), 1 deletion(-)
---
diff --git a/php.spec b/php.spec
index caf464d..162c3e3 100644
--- a/php.spec
+++ b/php.spec
@@ -143,7 +143,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine	with_alternatives
 %endif
 
-%define		rel	74
+%define		rel	75
 %define		orgname	php
 %define		ver_suffix 53
 %define		php_suffix %{!?with_default_php:%{ver_suffix}}
@@ -283,6 +283,7 @@ Patch240:	php-5.3.29-CVE-2026-126714.patch
 Patch241:	php-5.3.29-CVE-2026-128064.patch
 Patch242:	php-5.3.29-CVE-2026-127960.patch
 Patch243:	php-5.3.29-CVE-2026-129481.patch
+Patch244:	php-phar-openssl-sign-uaf.patch
 URL:		https://www.php.net/
 %{?with_interbase:%{!?with_interbase_inst:BuildRequires:	Firebird-devel >= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:	aspell-devel >= 2:0.50.0}
@@ -2212,6 +2213,7 @@ gzip -dc %{SOURCE15} | tar xf - -C sapi/
 %patch -P241 -p1
 %patch -P242 -p1
 %patch -P243 -p1
+%patch -P244 -p1
 # the patches carry the regenerated scanners, keep make from rebuilding them
 touch ext/date/lib/parse_date.c ext/standard/var_unserializer.c Zend/zend_ini_parser.c
 
diff --git a/php-phar-openssl-sign-uaf.patch b/php-phar-openssl-sign-uaf.patch
new file mode 100644
index 0000000..e918e08
--- /dev/null
+++ b/php-phar-openssl-sign-uaf.patch
@@ -0,0 +1,22 @@
+PLD-only: phar_call_openssl_signverify() freed the openssl_sign() result
+before testing it, so OpenSSL phar signing randomly fell back to SHA-1.
+
+--- a/ext/phar/util.c
++++ b/ext/phar/util.c
+@@ -1812,14 +1812,15 @@ static int phar_call_openssl_signverify(
+ 			efree(retval_ptr);
+ 			return FAILURE;
+ 		case IS_BOOL:
+-			efree(retval_ptr);
+ 			if (Z_BVAL_P(retval_ptr)) {
++				efree(retval_ptr);
+ 				*signature = estrndup(Z_STRVAL_P(zsig), Z_STRLEN_P(zsig));
+ 				*signature_len = Z_STRLEN_P(zsig);
+ 				zval_dtor(zsig);
+ 				efree(zsig);
+ 				return SUCCESS;
+ 			}
++			efree(retval_ptr);
+ 			zval_dtor(zsig);
+ 			efree(zsig);
+ 			return FAILURE;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/3a719788c351bb4550981eaa84fd8e5409386b9f



More information about the pld-cvs-commit mailing list