diff options
| author | Anil Dongare <adongare@cisco.com> | 2026-01-17 22:50:37 -0800 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@oss.qualcomm.com> | 2026-01-19 12:15:49 +0530 |
| commit | 2759d8870ea387b76c902070bed8a6649ff47b56 (patch) | |
| tree | 97b44c7613b3cbca1e4b3026ca9a968050449793 | |
| parent | 0feefa82c04a5287555a70108aad92492dfb5779 (diff) | |
| download | meta-openembedded-scarthgap.tar.gz | |
php 8.2.29: CVE-2025-14177scarthgap
Upstream Repository: https://github.com/php/php-src.git
Bug Details: https://nvd.nist.gov/vuln/detail/CVE-2025-14177
Type: Security Fix
CVE: CVE-2025-14177
Score: 7.5
Patch: https://github.com/php/php-src/commit/c5f28c7cf0a0
Signed-off-by: Anil Dongare <adongare@cisco.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
| -rw-r--r-- | meta-oe/recipes-devtools/php/php/CVE-2025-14177.patch | 84 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/php/php_8.2.29.bb | 1 |
2 files changed, 85 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/php/php/CVE-2025-14177.patch b/meta-oe/recipes-devtools/php/php/CVE-2025-14177.patch new file mode 100644 index 0000000000..6b5ffe0029 --- /dev/null +++ b/meta-oe/recipes-devtools/php/php/CVE-2025-14177.patch | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | From 7aac95c5280ea395ccfcd624cae7e87749ff6eeb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Niels Dossche <7771979+ndossche@users.noreply.github.com> | ||
| 3 | Date: Tue, 25 Nov 2025 23:11:38 +0100 | ||
| 4 | Subject: [PATCH] Fix GH-20584: Information Leak of Memory | ||
| 5 | |||
| 6 | The string added had uninitialized memory due to | ||
| 7 | php_read_stream_all_chunks() not moving the buffer position, resulting | ||
| 8 | in the same data always being overwritten instead of new data being | ||
| 9 | added to the end of the buffer. | ||
| 10 | |||
| 11 | This is backport as there is a security impact as described in | ||
| 12 | GHSA-3237-qqm7-mfv7 . | ||
| 13 | |||
| 14 | CVE: CVE-2025-14177 | ||
| 15 | Upstream-Status: Backport [https://github.com/php/php-src/commit/c5f28c7cf0a0] | ||
| 16 | |||
| 17 | (cherry picked from commit c5f28c7cf0a052f48e47877c7aa5c5bcc54f1cfc) | ||
| 18 | Signed-off-by: Anil Dongare <adongare@cisco.com> | ||
| 19 | --- | ||
| 20 | ext/standard/image.c | 1 + | ||
| 21 | ext/standard/tests/image/gh20584.phpt | 39 +++++++++++++++++++++++++++ | ||
| 22 | 2 files changed, 40 insertions(+) | ||
| 23 | create mode 100644 ext/standard/tests/image/gh20584.phpt | ||
| 24 | |||
| 25 | diff --git a/ext/standard/image.c b/ext/standard/image.c | ||
| 26 | index 2bd5429efac..15761364c34 100644 | ||
| 27 | --- a/ext/standard/image.c | ||
| 28 | +++ b/ext/standard/image.c | ||
| 29 | @@ -403,6 +403,7 @@ static size_t php_read_stream_all_chunks(php_stream *stream, char *buffer, size_ | ||
| 30 | if (read_now < stream->chunk_size && read_total != length) { | ||
| 31 | return 0; | ||
| 32 | } | ||
| 33 | + buffer += read_now; | ||
| 34 | } while (read_total < length); | ||
| 35 | |||
| 36 | return read_total; | ||
| 37 | diff --git a/ext/standard/tests/image/gh20584.phpt b/ext/standard/tests/image/gh20584.phpt | ||
| 38 | new file mode 100644 | ||
| 39 | index 00000000000..d117f218202 | ||
| 40 | --- /dev/null | ||
| 41 | +++ b/ext/standard/tests/image/gh20584.phpt | ||
| 42 | @@ -0,0 +1,39 @@ | ||
| 43 | +--TEST-- | ||
| 44 | +GH-20584 (Information Leak of Memory) | ||
| 45 | +--CREDITS-- | ||
| 46 | +Nikita Sveshnikov (Positive Technologies) | ||
| 47 | +--FILE-- | ||
| 48 | +<?php | ||
| 49 | +// Minimal PoC: corruption/uninitialized memory leak when reading APP1 via php://filter | ||
| 50 | +$file = __DIR__ . '/gh20584.jpg'; | ||
| 51 | + | ||
| 52 | +// Make APP1 large enough so it is read in multiple chunks | ||
| 53 | +$chunk = 8192; | ||
| 54 | +$tail = 123; | ||
| 55 | +$payload = str_repeat('A', $chunk) . str_repeat('B', $chunk) . str_repeat('Z', | ||
| 56 | +$tail); | ||
| 57 | +$app1Len = 2 + strlen($payload); | ||
| 58 | + | ||
| 59 | +// Minimal JPEG: SOI + APP1 + SOF0(1x1) + EOI | ||
| 60 | +$sof = "\xFF\xC0" . pack('n', 11) . "\x08" . pack('n',1) . pack('n',1) . | ||
| 61 | +"\x01\x11\x00"; | ||
| 62 | +$jpeg = "\xFF\xD8" . "\xFF\xE1" . pack('n', $app1Len) . $payload . $sof . | ||
| 63 | +"\xFF\xD9"; | ||
| 64 | +file_put_contents($file, $jpeg); | ||
| 65 | + | ||
| 66 | +// Read through a filter to enforce multiple reads | ||
| 67 | +$src = 'php://filter/read=string.rot13|string.rot13/resource=' . $file; | ||
| 68 | +$info = null; | ||
| 69 | +@getimagesize($src, $info); | ||
| 70 | +$exp = $payload; | ||
| 71 | +$ret = $info['APP1']; | ||
| 72 | + | ||
| 73 | +var_dump($ret === $exp); | ||
| 74 | + | ||
| 75 | +?> | ||
| 76 | +--CLEAN-- | ||
| 77 | +<?php | ||
| 78 | +@unlink(__DIR__ . '/gh20584.jpg'); | ||
| 79 | +?> | ||
| 80 | +--EXPECT-- | ||
| 81 | +bool(true) | ||
| 82 | -- | ||
| 83 | 2.43.5 | ||
| 84 | |||
diff --git a/meta-oe/recipes-devtools/php/php_8.2.29.bb b/meta-oe/recipes-devtools/php/php_8.2.29.bb index 08cece1c17..015d83c291 100644 --- a/meta-oe/recipes-devtools/php/php_8.2.29.bb +++ b/meta-oe/recipes-devtools/php/php_8.2.29.bb | |||
| @@ -20,6 +20,7 @@ SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \ | |||
| 20 | file://0009-php-don-t-use-broken-wrapper-for-mkdir.patch \ | 20 | file://0009-php-don-t-use-broken-wrapper-for-mkdir.patch \ |
| 21 | file://0010-iconv-fix-detection.patch \ | 21 | file://0010-iconv-fix-detection.patch \ |
| 22 | file://0001-Change-whether-to-inline-XXH3_hashLong_withSecret-to.patch \ | 22 | file://0001-Change-whether-to-inline-XXH3_hashLong_withSecret-to.patch \ |
| 23 | file://CVE-2025-14177.patch \ | ||
| 23 | " | 24 | " |
| 24 | 25 | ||
| 25 | SRC_URI:append:class-target = " \ | 26 | SRC_URI:append:class-target = " \ |
