diff options
| author | Peter Marko <peter.marko@siemens.com> | 2026-02-22 23:00:17 +0100 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@oss.qualcomm.com> | 2026-02-25 13:00:46 +0530 |
| commit | 4e4ad54c9ae346abaaa1d05eddb6c45d36c30aac (patch) | |
| tree | 4ec4666652b56b84ca4337ce33e055f45413fe7e | |
| parent | c88db38ad668e7333d20f82697c4ffc64ec862d9 (diff) | |
| download | meta-openembedded-4e4ad54c9ae346abaaa1d05eddb6c45d36c30aac.tar.gz | |
fcgi: add follow-up patch for CVE-2025-23016
New release [1] added additional fir for this CVE.
[1] https://github.com/FastCGI-Archives/fcgi2/releases/tag/2.4.7
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
| -rw-r--r-- | meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016-01.patch (renamed from meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016.patch) | 0 | ||||
| -rw-r--r-- | meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016-02.patch | 83 | ||||
| -rw-r--r-- | meta-webserver/recipes-support/fcgi/fcgi_git.bb | 3 |
3 files changed, 85 insertions, 1 deletions
diff --git a/meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016.patch b/meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016-01.patch index b763d7651c..b763d7651c 100644 --- a/meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016.patch +++ b/meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016-01.patch | |||
diff --git a/meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016-02.patch b/meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016-02.patch new file mode 100644 index 0000000000..1f855db3e0 --- /dev/null +++ b/meta-webserver/recipes-support/fcgi/fcgi/CVE-2025-23016-02.patch | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | From 7c476394e799f39f749d7a7a50f62e5d3ec8db61 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> | ||
| 3 | Date: Mon, 19 May 2025 13:49:32 +0200 | ||
| 4 | Subject: [PATCH] Fix size_t overflow in Malloc() argument in ReadParams() | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | There were still two issues after commit | ||
| 10 | b0eabcaf4d4f371514891a52115c746815c2ff15 (Update fcgiapp.c, Fixing an | ||
| 11 | integer overflow (CVE-2025-23016)): | ||
| 12 | |||
| 13 | * Signed int overflow in "nameLen + valueLen + 2" expression. | ||
| 14 | |||
| 15 | * Sizes of size_t and int types are in general unrelated. | ||
| 16 | |||
| 17 | This fix resolves both of the issues. | ||
| 18 | |||
| 19 | Related to CVE-2025-23016. | ||
| 20 | Resolve #67. | ||
| 21 | |||
| 22 | Signed-off-by: Petr Písař <ppisar@redhat.com> | ||
| 23 | |||
| 24 | CVE: CVE-2025-23016 | ||
| 25 | Upstream-Status: Backport [https://github.com/FastCGI-Archives/fcgi2/commit/7c476394e799f39f749d7a7a50f62e5d3ec8db61] | ||
| 26 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 27 | --- | ||
| 28 | libfcgi/fcgiapp.c | 13 ++++++++++--- | ||
| 29 | 1 file changed, 10 insertions(+), 3 deletions(-) | ||
| 30 | |||
| 31 | diff --git a/libfcgi/fcgiapp.c b/libfcgi/fcgiapp.c | ||
| 32 | index 99c3630..0cd3dd1 100644 | ||
| 33 | --- a/libfcgi/fcgiapp.c | ||
| 34 | +++ b/libfcgi/fcgiapp.c | ||
| 35 | @@ -18,6 +18,7 @@ | ||
| 36 | #include <memory.h> /* for memchr() */ | ||
| 37 | #include <stdarg.h> | ||
| 38 | #include <stdio.h> | ||
| 39 | +#include <stdint.h> | ||
| 40 | #include <stdlib.h> | ||
| 41 | #include <string.h> | ||
| 42 | #include <sys/types.h> | ||
| 43 | @@ -1158,6 +1159,7 @@ char *FCGX_GetParam(const char *name, FCGX_ParamArray envp) | ||
| 44 | static int ReadParams(Params *paramsPtr, FCGX_Stream *stream) | ||
| 45 | { | ||
| 46 | int nameLen, valueLen; | ||
| 47 | + size_t totalLen; | ||
| 48 | unsigned char lenBuff[3]; | ||
| 49 | char *nameValue; | ||
| 50 | |||
| 51 | @@ -1173,7 +1175,7 @@ static int ReadParams(Params *paramsPtr, FCGX_Stream *stream) | ||
| 52 | } | ||
| 53 | nameLen = ((nameLen & 0x7f) << 24) + (lenBuff[0] << 16) | ||
| 54 | + (lenBuff[1] << 8) + lenBuff[2]; | ||
| 55 | - if (nameLen >= INT_MAX) { | ||
| 56 | + if (nameLen >= INT_MAX || nameLen >= SIZE_MAX) { | ||
| 57 | SetError(stream, FCGX_PARAMS_ERROR); | ||
| 58 | return -1; | ||
| 59 | } | ||
| 60 | @@ -1189,16 +1191,21 @@ static int ReadParams(Params *paramsPtr, FCGX_Stream *stream) | ||
| 61 | } | ||
| 62 | valueLen = ((valueLen & 0x7f) << 24) + (lenBuff[0] << 16) | ||
| 63 | + (lenBuff[1] << 8) + lenBuff[2]; | ||
| 64 | - if (valueLen >= INT_MAX) { | ||
| 65 | + if (valueLen >= INT_MAX || valueLen >= SIZE_MAX) { | ||
| 66 | SetError(stream, FCGX_PARAMS_ERROR); | ||
| 67 | return -1; | ||
| 68 | } | ||
| 69 | } | ||
| 70 | + totalLen = (size_t)nameLen + (size_t)valueLen + 2u; | ||
| 71 | + if (totalLen < (size_t)nameLen || totalLen < (size_t)valueLen) { | ||
| 72 | + SetError(stream, FCGX_PARAMS_ERROR); | ||
| 73 | + return -1; | ||
| 74 | + } | ||
| 75 | /* | ||
| 76 | * nameLen and valueLen are now valid; read the name and value | ||
| 77 | * from stream and construct a standard environment entry. | ||
| 78 | */ | ||
| 79 | - nameValue = (char *)Malloc(nameLen + valueLen + 2); | ||
| 80 | + nameValue = (char *)Malloc(totalLen); | ||
| 81 | if(FCGX_GetStr(nameValue, nameLen, stream) != nameLen) { | ||
| 82 | SetError(stream, FCGX_PARAMS_ERROR); | ||
| 83 | free(nameValue); | ||
diff --git a/meta-webserver/recipes-support/fcgi/fcgi_git.bb b/meta-webserver/recipes-support/fcgi/fcgi_git.bb index d327d435d5..b83f8a872d 100644 --- a/meta-webserver/recipes-support/fcgi/fcgi_git.bb +++ b/meta-webserver/recipes-support/fcgi/fcgi_git.bb | |||
| @@ -7,7 +7,8 @@ SRCREV = "382aa2b0d53a87c27f2f647dfaf670375ba0b85f" | |||
| 7 | PV = "2.4.2" | 7 | PV = "2.4.2" |
| 8 | 8 | ||
| 9 | SRC_URI = "git://github.com/FastCGI-Archives/fcgi2.git;protocol=https;branch=master \ | 9 | SRC_URI = "git://github.com/FastCGI-Archives/fcgi2.git;protocol=https;branch=master \ |
| 10 | file://CVE-2025-23016.patch \ | 10 | file://CVE-2025-23016-01.patch \ |
| 11 | file://CVE-2025-23016-02.patch \ | ||
| 11 | " | 12 | " |
| 12 | 13 | ||
| 13 | S = "${WORKDIR}/git" | 14 | S = "${WORKDIR}/git" |
