Projects
home:rottame:vhosts-ng:php74
php7
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 26
View file
php7.changes
Changed
@@ -1,4 +1,22 @@ ------------------------------------------------------------------- +Fri Nov 27 10:36:52 UTC 2026 - Angelo Grossini <rottame@intercom.it> + +- drop Patch47 (php7-CVE-2025-1735.patch): it uses the PHP 8 API + (zend_argument_value_error, RETURN_THROWS), leaving pgsql.so with + undefined symbols, and frees the wrong pointer in pdo_pgsql on + escaping errors +- add php7-CVE-2025-1735-remi.patch (Patch902): the PHP 7.4 backport + from remicollet/php-src-security (df2ecf34256c + 68c07d5a9079) + +------------------------------------------------------------------- +Fri Nov 27 10:24:19 UTC 2026 - Angelo Grossini <rottame@intercom.it> + +- fpm: use %service_del_postun, drop the %posttrans with + %_restart_on_update: the macro is not defined on Leap 16.1, the + literal text made the scriptlet fail (exit 1) and + %service_del_postun_without_restart expands to a no-op there + +------------------------------------------------------------------- Thu Nov 26 13:14:43 UTC 2026 - Angelo Grossini <rottame@intercom.it> - restore session-save-path.patch (session.save_path = /tmp), lost in the Leap 16 port
View file
php7.spec
Changed
@@ -106,6 +106,9 @@ Patch900: php7-intl-cxx17.patch # vhng Leap 16: ext/xml entity handling with libxml2 >= 2.13 (php-src GH-14834) Patch901: php7-xml-libxml213.patch +# vhng: CVE-2025-1735 PHP 7.4 backport from remicollet/php-src-security, replaces +# upstream Patch47 (PHP 8 API, pgsql.so with undefined symbols) +Patch902: php7-CVE-2025-1735-remi.patch # vhng: session.save_path = /tmp (as the other branches) Patch1000: session-save-path.patch # https://github.com/php/php-src/commit/b3646440b1808abf0874b6f89027ce53ec5da03f @@ -160,8 +163,6 @@ Patch45: php7-CVE-2025-6491.patch # CVE-2025-1220 bsc#1246167, unprocessed null bytes in hostnames can lead to SSRF Patch46: php7-CVE-2025-1220.patch -# CVE-2025-1735 bsc#1246146, pgsql extension does not properly handle errors within escape functions -Patch47: php7-CVE-2025-1735.patch # CVE-2025-14178 bsc#1255711, heap buffer overflow occurs in array_merge() when the total element count of packed arrays exceeds 32-bit limits or HT_MAX_SIZE Patch48: php7-CVE-2025-14178.patch # CVE-2026-7568: integer overflow in the `metaphone` function can lead to undefined behavior and affect the availability of the PHPprocess bsc#1264769 @@ -1561,15 +1562,7 @@ %service_del_preun php-fpm.service %postun -# do not try-restart yet as extensions may be updated too -%if 0%{?suse_version} > 1500 -%service_del_postun_without_restart php-fpm.service -%else -%service_del_postun -n php-fpm.service -%endif - -%posttrans -%_restart_on_update php-fpm.service +%service_del_postun php-fpm.service %endif %if "%{flavor}" == "embed"
View file
php7-CVE-2025-1735-remi.patch
Added
@@ -0,0 +1,434 @@ +Backport of GHSA-hrwm-9436-5mv3 (CVE-2025-1735) for PHP 7.4, from +https://github.com/remicollet/php-src-security branch PHP-7.4-security-backports: + +- df2ecf34256c4a301e8959fe2eed0323f8b1b57a (Jakub Zelenka) + Fix GHSA-hrwm-9436-5mv3: pgsql escaping no error checks +- 68c07d5a9079703635a988ae1751744e704509a4 + Fix GHSA-hrwm-9436-5mv3: release the escaped string when escaping fails + +Replaces upstream Patch47 (php7-CVE-2025-1735.patch), which used the PHP 8 API +(zend_argument_value_error, RETURN_THROWS) and left pgsql.so with +undefined symbols. + +--- a/ext/pdo_pgsql/pgsql_driver.c 2022-10-31 11:36:13.000000000 +0100 ++++ b/ext/pdo_pgsql/pgsql_driver.c 2026-11-27 11:53:48.300180259 +0100 +@@ -323,11 +323,15 @@ + unsigned char *escaped; + pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; + size_t tmp_len; ++ int err; + + switch (paramtype) { + case PDO_PARAM_LOB: + /* escapedlen returned by PQescapeBytea() accounts for trailing 0 */ + escaped = PQescapeByteaConn(H->server, (unsigned char *)unquoted, unquotedlen, &tmp_len); ++ if (escaped == NULL) { ++ return 0; ++ } + *quotedlen = tmp_len + 1; + *quoted = emalloc(*quotedlen + 1); + memcpy((*quoted)+1, escaped, *quotedlen-2); +@@ -339,7 +343,11 @@ + default: + *quoted = safe_emalloc(2, unquotedlen, 3); + (*quoted)0 = '\''; +- *quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, unquotedlen, NULL); ++ *quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, unquotedlen, &err); ++ if (err) { ++ efree(*quoted); ++ return 0; ++ } + (*quoted)*quotedlen + 1 = '\''; + (*quoted)*quotedlen + 2 = '\0'; + *quotedlen += 2; +--- a/ext/pdo_pgsql/tests/ghsa-hrwm-9436-5mv3.phpt 1970-01-01 01:00:00.000000000 +0100 ++++ b/ext/pdo_pgsql/tests/ghsa-hrwm-9436-5mv3.phpt 2026-11-27 11:53:48.300256107 +0100 +@@ -0,0 +1,22 @@ ++--TEST-- ++#GHSA-hrwm-9436-5mv3: pdo_pgsql extension does not check for errors during escaping ++--SKIPIF-- ++<?php ++if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); ++require_once dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; ++require_once dirname(__FILE__) . '/config.inc'; ++PDOTest::skip(); ++?> ++--FILE-- ++<?php ++require_once dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; ++require_once dirname(__FILE__) . '/config.inc'; ++$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); ++$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); ++ ++$invalid = "ABC\xff\x30';"; ++var_dump($db->quote($invalid)); ++ ++?> ++--EXPECT-- ++bool(false) +--- a/ext/pgsql/pgsql.c 2026-11-27 11:53:47.175099618 +0100 ++++ b/ext/pgsql/pgsql.c 2026-11-27 11:53:48.302093938 +0100 +@@ -4393,10 +4393,16 @@ + to = zend_string_safe_alloc(ZSTR_LEN(from), 2, 0, 0); + #ifdef HAVE_PQESCAPE_CONN + if (link) { ++ int err; + if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) { + RETURN_FALSE; + } +- ZSTR_LEN(to) = PQescapeStringConn(pgsql, ZSTR_VAL(to), ZSTR_VAL(from), ZSTR_LEN(from), NULL); ++ ZSTR_LEN(to) = PQescapeStringConn(pgsql, ZSTR_VAL(to), ZSTR_VAL(from), ZSTR_LEN(from), &err); ++ if (err) { ++ zend_throw_exception(zend_ce_exception, "Escaping string failed", 0); ++ zend_string_efree(to); ++ return; ++ } + } else + #endif + { +@@ -4445,6 +4451,10 @@ + } else + #endif + to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len); ++ if (to == NULL) { ++ zend_throw_exception(zend_ce_exception, "Escape failure", 0); ++ return; ++ } + + RETVAL_STRINGL(to, to_len-1); /* to_len includes additional '\0' */ + PQfreemem(to); +@@ -5529,7 +5539,7 @@ + char *escaped; + smart_str querystr = {0}; + size_t new_len; +- int i, num_rows; ++ int i, num_rows, err; + zval elem; + + if (!*table_name) { +@@ -5570,7 +5580,14 @@ + "WHERE a.attnum > 0 AND c.relname = '"); + } + escaped = (char *)safe_emalloc(strlen(tmp_name2), 2, 1); +- new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, strlen(tmp_name2), NULL); ++ new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, strlen(tmp_name2), &err); ++ if (err) { ++ php_error_docref(NULL, E_WARNING, "Escaping table name '%s' failed", table_name); ++ efree(src); ++ efree(escaped); ++ smart_str_free(&querystr); ++ return FAILURE; ++ } + if (new_len) { + smart_str_appendl(&querystr, escaped, new_len); + } +@@ -5578,7 +5595,14 @@ + + smart_str_appends(&querystr, "' AND n.nspname = '"); + escaped = (char *)safe_emalloc(strlen(tmp_name), 2, 1); +- new_len = PQescapeStringConn(pg_link, escaped, tmp_name, strlen(tmp_name), NULL); ++ new_len = PQescapeStringConn(pg_link, escaped, tmp_name, strlen(tmp_name), &err); ++ if (err) { ++ php_error_docref(NULL, E_WARNING, "Escaping table namespace '%s' failed", table_name); ++ efree(src); ++ efree(escaped); ++ smart_str_free(&querystr); ++ return FAILURE; ++ } + if (new_len) { + smart_str_appendl(&querystr, escaped, new_len); + } +@@ -5849,7 +5873,7 @@ + { + zend_string *field = NULL; + zval meta, *def, *type, *not_null, *has_default, *is_enum, *val, new_val; +- int err = 0, skip_field; ++ int err = 0, escape_err = 0, skip_field; + php_pgsql_data_type data_type; + + assert(pg_link != NULL); +@@ -6100,10 +6124,15 @@ + /* PostgreSQL ignores \0 */ + str = zend_string_alloc(Z_STRLEN_P(val) * 2, 0); + /* better to use PGSQLescapeLiteral since PGescapeStringConn does not handle special \ */ +- ZSTR_LEN(str) = PQescapeStringConn(pg_link, ZSTR_VAL(str), Z_STRVAL_P(val), Z_STRLEN_P(val), NULL); +- str = zend_string_truncate(str, ZSTR_LEN(str), 0); +- ZVAL_NEW_STR(&new_val, str); +- php_pgsql_add_quotes(&new_val, 1); ++ ZSTR_LEN(str) = PQescapeStringConn(pg_link, ZSTR_VAL(str), Z_STRVAL_P(val), Z_STRLEN_P(val), &escape_err); ++ if (escape_err) { ++ err = 1; ++ zend_string_release_ex(str, 0); ++ } else { ++ str = zend_string_truncate(str, ZSTR_LEN(str), 0); ++ ZVAL_NEW_STR(&new_val, str); ++ php_pgsql_add_quotes(&new_val, 1); ++ } + } + break; + +@@ -6125,7 +6154,15 @@ + } + PGSQL_CONV_CHECK_IGNORE(); + if (err) { +- php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), ZSTR_VAL(field)); ++ if (escape_err) { ++ php_error_docref(NULL, E_NOTICE, ++ "String value escaping failed for PostgreSQL '%s' (%s)", ++ Z_STRVAL_P(type), ZSTR_VAL(field)); ++ } else { ++ php_error_docref(NULL, E_NOTICE, ++ "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", ++ Z_STRVAL_P(type), ZSTR_VAL(field)); ++ } + } + break; + +@@ -6405,6 +6442,11 @@ + #else + tmp = PQescapeBytea(Z_STRVAL_P(val), (unsigned char *)Z_STRLEN_P(val), &to_len); + #endif ++ if (tmp == NULL) { ++ php_error_docref(NULL, E_NOTICE, "Escaping value failed for %s field (%s)", Z_STRVAL_P(type), ZSTR_VAL(field)); ++ err = 1; ++ break; ++ } + ZVAL_STRINGL(&new_val, (char *)tmp, to_len - 1); /* PQescapeBytea's to_len includes additional '\0' */ + PQfreemem(tmp); + php_pgsql_add_quotes(&new_val, 1); +@@ -6487,6 +6529,12 @@
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.