Compare commits

...
2 Commits
Author SHA1 Message Date
chrisandClaude Opus 5.5 5494ccc9df mod_php_install.sh: apply security patches for PHP 5.6.40.
Apply for PHP 5.6.40, in boa order: openssl3-pkey-export,
round-places-overflow, sury-105, xlts-1, xlts-2. All apply without fuzz
on top of the OpenSSL 1.1.0 compatibility patch and the php-5.6-*.patch
files.

Skip php-5.6-enhanced-universal.patch (php2shell) for 5.6.40: sury-105
brings its own backport of the CVE-2026-109618/109619 fix, the same fix
boa uses for 7.4/8.x. Both change the same code and exclude each other.

Tested on web-04 (Debian 13): build, install and php-fpm start OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:13:05 +01:00
chrisandClaude Opus 5.5 7b6bb066dc Add security patches for PHP 5.6.40.
From omega8cc/boa (5.x-dev, aegir/patches/php-sec):
php-5.6.40-openssl3-pkey-export.patch, php-5.6.40-round-places-overflow.patch,
php-5.6.40-sury-105.patch, php-5.6.40-xlts-1.patch, php-5.6.40-xlts-2.patch.

sury-105 contains the 5.6 backport of the CVE-2026-109618/109619 fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:13:05 +01:00
6 changed files with 233151 additions and 2 deletions

No files matched your search

+28 -2
View File
@@ -6380,9 +6380,16 @@ fi
# - # -
# - Security fix: if it fails, abort - never build PHP 5.6 without it. # - Security fix: if it fails, abort - never build PHP 5.6 without it.
# - # -
# - NOT for 5.6.40: there 'php-5.6.40-sury-105.patch' (omega8cc/boa, see
# - below) brings its own backport of the CVE-2026-109618/109619 fix - the
# - same fix boa uses for 7.4/8.x (session upload progress disabled,
# - array_init_singleton, zend_mm_safe_error_ex, MIME header filter,
# - max_multipart_body_parts, ...). Both patches change the same code and
# - exclude each other: with this patch applied, sury-105 and xlts-2 fail.
# -
_patch_file="php-5.6-enhanced-universal.patch" _patch_file="php-5.6-enhanced-universal.patch"
echononl "\tApply ${_patch_file} (php2shell)" echononl "\tApply ${_patch_file} (php2shell)"
if [[ "$PHP_MAIN_VERSION" = "5.6" ]]; then if [[ "$PHP_MAIN_VERSION" = "5.6" ]] && [[ "$VERSION" != "5.6.40" ]]; then
if [[ -f "${_srcdir}/${_patch_file}" ]] ; then if [[ -f "${_srcdir}/${_patch_file}" ]] ; then
patch -d $_builddir -p1 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 patch -d $_builddir -p1 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
@@ -6399,9 +6406,20 @@ else
echo_skipped echo_skipped
fi fi
# - Security patches for PHP 7.4.33, 8.0.30 and 8.1.34 # - Security patches for PHP 5.6.40, 7.4.33, 8.0.30 and 8.1.34
# - (source: omega8cc/boa, aegir/patches/php-sec) # - (source: omega8cc/boa, aegir/patches/php-sec)
# - # -
# - PHP 5.6.40 (boa order = glob order, applied with --fuzz=0 by boa):
# - php-5.6.40-openssl3-pkey-export.patch
# - php-5.6.40-round-places-overflow.patch
# - php-5.6.40-sury-105.patch (backports, Debian/sury; contains
# - the CVE-2026-109618/109619 fix)
# - php-5.6.40-xlts-1.patch
# - php-5.6.40-xlts-2.patch (needs sury-105 and xlts-1)
# - On top of 'PHP-5.6.31-OpenSSL-1.1.0-compatibility-20170801.patch' and
# - the php-5.6-*.patch files above all apply without fuzz (offsets only).
# - They change no generated files (Zend VM, re2c).
# -
# - PHP 7.4.33: # - PHP 7.4.33:
# - php-7.4.33-cve-2026-109618-109619.patch # - php-7.4.33-cve-2026-109618-109619.patch
# - php-7.4.33-sury-31.patch (backports from 8.x, Debian/sury) # - php-7.4.33-sury-31.patch (backports from 8.x, Debian/sury)
@@ -6445,6 +6463,14 @@ fi
# - Security fixes: if one fails, abort - never build PHP without them. # - Security fixes: if one fails, abort - never build PHP without them.
# - # -
case "$VERSION" in case "$VERSION" in
5.6.40)
_sec_patches="
php-5.6.40-openssl3-pkey-export.patch
php-5.6.40-round-places-overflow.patch
php-5.6.40-sury-105.patch
php-5.6.40-xlts-1.patch
php-5.6.40-xlts-2.patch"
;;
7.4.33) 7.4.33)
_sec_patches=" _sec_patches="
php-7.4.33-cve-2026-109618-109619.patch php-7.4.33-cve-2026-109618-109619.patch
+22
View File
@@ -0,0 +1,22 @@
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index af376aa..5116a4a 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4001,6 +4001,9 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) {
bio_out = BIO_new_file(filename, "w");
+ if (bio_out == NULL) {
+ goto clean_exit;
+ }
if (passphrase && req.priv_key_encrypt) {
if (req.priv_key_encrypt_cipher) {
@@ -4029,6 +4032,7 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
RETVAL_TRUE;
}
}
+clean_exit:
PHP_SSL_REQ_DISPOSE(&req);
if (key_resource == -1 && key) {
+20
View File
@@ -0,0 +1,20 @@
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -141,7 +141,7 @@
double tmp_value;
int precision_places;
- if (!php_math_is_finite(value)) {
+ if (!php_math_is_finite(value) || value == 0.0) {
return value;
}
@@ -153,7 +153,7 @@
/* If the decimal precision guaranteed by FP arithmetic is higher than
the requested places BUT is small enough to make sure a non-zero value
is returned, pre-round the result to the precision */
- if (precision_places > places && precision_places - places < 15) {
+ if (precision_places > places && precision_places - 15 < places) {
int64_t use_precision = precision_places < INT_MIN+1 ? INT_MIN+1 : precision_places;
f2 = php_intpow10(abs((int)use_precision));
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff