From f1b9a1d04e403ede57d97438b989804fb77b51fc Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 7 Jun 2023 13:08:13 +0200 Subject: Fix insufficient random bytes in HTTP Digest authentication for SOAP GHSA-76gg-c692-v2mw use oracle client library version 21.10 define __phpize and __phpconfig --- macros.php | 4 ++++ php-ghsa-76gg-c692-v2mw.patch | 48 +++++++++++++++++++++++++++++++++++++++++++ php56.spec | 14 ++++++++++--- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 php-ghsa-76gg-c692-v2mw.patch diff --git a/macros.php b/macros.php index 0c750a7..e27985c 100644 --- a/macros.php +++ b/macros.php @@ -18,4 +18,8 @@ %__php %{_bindir}/php %__ztsphp %{_bindir}/zts-php +%__phpize %{_bindir}/phpize +%__ztsphpize %{_bindir}/zts-phpize +%__phpconfig %{_bindir}/php-config +%__ztsphpconfig %{_bindir}/zts-php-config diff --git a/php-ghsa-76gg-c692-v2mw.patch b/php-ghsa-76gg-c692-v2mw.patch new file mode 100644 index 0000000..7bd598f --- /dev/null +++ b/php-ghsa-76gg-c692-v2mw.patch @@ -0,0 +1,48 @@ +From 66e67c73b83b42234530b6681dc16aac5efaf0f7 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 7 Jun 2023 10:11:02 +0200 +Subject: [PATCH] Increase random bytes in HTTP Digest authentication for SOAP + Minimal fix for GHSA-76gg-c692-v2mw + +--- + NEWS | 6 ++++++ + ext/soap/php_http.c | 7 +++++-- + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/NEWS b/NEWS +index c9e6f7d3285..d32f3d7a874 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,6 +1,12 @@ + PHP NEWS + ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| + ++Backported from 8.0.29 ++ ++- Soap: ++ . Fixed bug GHSA-76gg-c692-v2mw (Missing error check and insufficient random ++ bytes in HTTP Digest authentication for SOAP). (nielsdos, timwolla) ++ + Backported from 8.0.28 + + - Core: +diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c +index 324609197ad..f3935cb1b79 100644 +--- a/ext/soap/php_http.c ++++ b/ext/soap/php_http.c +@@ -639,10 +639,13 @@ int make_http_soap_request(zval *this_ptr, + char HA1[33], HA2[33], response[33], cnonce[33], nc[9]; + PHP_MD5_CTX md5ctx; + unsigned char hash[16]; ++ int i; + + PHP_MD5Init(&md5ctx); +- snprintf(cnonce, sizeof(cnonce), "%ld", php_rand(TSRMLS_C)); +- PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce)); ++ for (i = 0; i < 4; i++) { /* 16 bytes of randomness*/ ++ snprintf(cnonce, sizeof(cnonce), "%ld", php_rand(TSRMLS_C)); ++ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce)); ++ } + PHP_MD5Final(hash, &md5ctx); + make_digest(cnonce, hash); + diff --git a/php56.spec b/php56.spec index 72cee1e..7700d51 100644 --- a/php56.spec +++ b/php56.spec @@ -28,7 +28,7 @@ %global mysql_sock %(mysql_config --socket 2>/dev/null || echo /var/lib/mysql/mysql.sock) -%global oraclever 21.8 +%global oraclever 21.10 %global oraclelib 21.1 # Build for LiteSpeed Web Server (LSAPI) @@ -143,7 +143,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: php Version: 5.6.40 -Release: 36%{?dist} +Release: 37%{?dist} # All files licensed under PHP version 3.01, except # Zend is licensed under Zend # TSRM is licensed under BSD @@ -260,6 +260,7 @@ Patch259: php-bug81740.patch Patch260: php-bug81744.patch Patch261: php-bug81746.patch Patch262: php-cve-2023-0662.patch +Patch263: php-ghsa-76gg-c692-v2mw.patch # Fixes for tests (300+) # Factory is droped from system tzdata @@ -1079,6 +1080,7 @@ echo CIBLE = %{name}-%{version}-%{release} oci8=%{with_oci8} libzip=%{with_libzi %patch260 -p1 -b .bug81744 %patch261 -p1 -b .bug81746 %patch262 -p1 -b .cve0662 +%patch263 -p1 -b .ghsa-76gg-c692-v2mw # Fixes for tests %patch300 -p1 -b .datetests @@ -1855,7 +1857,7 @@ sed -e "s/@PHP_APIVER@/%{apiver}%{isasuffix}/" \ %endif < %{SOURCE3} > macros.php %if 0%{?fedora} >= 24 -echo '%%pecl_xmldir %{_localstatedir}/lib/php/peclxml' >>macros.php +echo '%%pecl_xmldir %%{_localstatedir}/lib/php/peclxml' >>macros.php %endif install -m 644 -D macros.php \ $RPM_BUILD_ROOT%{macrosdir}/macros.php @@ -2135,6 +2137,12 @@ EOF %changelog +* Wed Jun 7 2023 Remi Collet - 5.6.40-37 +- Fix insufficient random bytes in HTTP Digest authentication for SOAP + GHSA-76gg-c692-v2mw +- use oracle client library version 21.10 +- define __phpize and __phpconfig + * Tue Feb 14 2023 Remi Collet - 5.6.40-36 - fix #81744: Password_verify() always return true with some hash CVE-2023-0567 -- cgit