botan: patch CVE-2024-34703
PATCH 1/5 botan: patch CVE-2024-34703
From: Ankur Tyagi <[email protected]>
Details https://nvd.nist.gov/vuln/detail/CVE-2024-34703
--- .../botan/botan/CVE-2024-34703.patch | 38 +++++++++++++++++++ meta-oe/recipes-crypto/botan/botan_3.2.0.bb | 4 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-crypto/botan/botan/CVE-2024-34703.patch
meta-oe/recipes-crypto/botan/botan/CVE-2024-34703.patch new file +38 -0
@@ -0,0 +1,38 @@ +From 0d7909e8d88782fd827ed6869563c435f418c5ff Mon Sep 17 00:00:00 2001 +From: Jack Lloyd <[email protected]> +Date: Tue, 20 Feb 2024 06:30:10 -0500 +Subject: [PATCH] When decoding an arbitrary elliptic curve, set an upper bound + on length + +Otherwise it's trivial to send a very large prime, which can take a +significant amount of computation to check. + +Reported by Bing Shi + +CVE: CVE-2024-34703 +Upstream-Status: Backport [https://github.com/randombit/botan/commit/fbe9ec578a8548958677224d2e60d2c2c838bc9a] +(cherry picked from commit fbe9ec578a8548958677224d2e60d2c2c838bc9a) +Signed-off-by: Ankur Tyagi <[email protected]> +--- + src/lib/pubkey/ec_group/ec_group.cpp | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/lib/pubkey/ec_group/ec_group.cpp b/src/lib/pubkey/ec_group/ec_group.cpp +index eb4ed90e2..beaeedd51 100644 +--- a/src/lib/pubkey/ec_group/ec_group.cpp ++++ b/src/lib/pubkey/ec_group/ec_group.cpp +@@ -357,8 +357,12 @@ std::pair<std::shared_ptr<EC_Group_Data>, bool> EC_Group::BER_decode_EC_group(co + .end_cons() + .verify_end(); + +- if(p.bits() < 64 || p.is_negative() || !is_bailie_psw_probable_prime(p)) { +- throw Decoding_Error("Invalid ECC p parameter"); ++ if(p.bits() < 112 || p.bits() > 1024) { ++ throw Decoding_Error("ECC p parameter is invalid size"); ++ } ++ ++ if(p.is_negative() || !is_bailie_psw_probable_prime(p)) { ++ throw Decoding_Error("ECC p parameter is not a prime"); + } + + if(a.is_negative() || a >= p) {
meta-oe/recipes-crypto/botan/botan_3.2.0.bb +3 -1
@@ -4,7 +4,9 @@ LICENSE = "BSD-2-Clause" LIC_FILES_CHKSUM = "file://license.txt;md5=f5254d3abe90ec5bb82c5694ff751546" SECTION = "libs" -SRC_URI = "https://botan.randombit.net/releases/Botan-${PV}.tar.xz" +SRC_URI = "https://botan.randombit.net/releases/Botan-${PV}.tar.xz \ + file://CVE-2024-34703.patch \ +" SRC_URI[sha256sum] = "049c847835fcf6ef3a9e206b33de05dd38999c325e247482772a5598d9e5ece3" S = "${WORKDIR}/Botan-${PV}"
PATCH 2/5 botan: patch CVE-2024-50382 and CVE-2024-50383
From: Ankur Tyagi <[email protected]>
Same patch fixes both vulnerabilities.
Details:
https://nvd.nist.gov/vuln/detail/CVE-2024-50382
https://nvd.nist.gov/vuln/detail/CVE-2024-50383
--- .../CVE-2024-50382-and-CVE-2024-50383.patch | 66 +++++++++++++++++++ meta-oe/recipes-crypto/botan/botan_3.2.0.bb | 1 + 2 files changed, 67 insertions(+) create mode 100644 meta-oe/recipes-crypto/botan/botan/CVE-2024-50382-and-CVE-2024-50383.patch
meta-oe/recipes-crypto/botan/botan/CVE-2024-50382-and-CVE-2024-50383.patch new file +66 -0
@@ -0,0 +1,66 @@ +From 157bf1cd6877e16084e910d68c1844ac73b4f6ff Mon Sep 17 00:00:00 2001 +From: Jack Lloyd <[email protected]> +Date: Sat, 19 Oct 2024 07:43:18 -0400 +Subject: [PATCH] Add more value barriers to avoid compiler induced side + channels + +The paper https://arxiv.org/pdf/2410.13489 claims that on specific +architectures Clang and GCC may introduce jumps here. The donna128 +issues only affect 32-bit processors, which explains why we would not +see it in the x86-64 valgrind runs. + +The GHASH leak would seem to be generic but the authors only observed +it on RISC-V. + +CVE: CVE-2024-50382 +CVE: CVE-2024-50383 +Upstream-Status: Backport [https://github.com/randombit/botan/commit/53b0cfde580e86b03d0d27a488b6c134f662e957] +(cherry picked from commit 53b0cfde580e86b03d0d27a488b6c134f662e957) +Signed-off-by: Ankur Tyagi <[email protected]> +--- + src/lib/utils/donna128.h | 5 +++-- + src/lib/utils/ghash/ghash.cpp | 2 +- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/lib/utils/donna128.h b/src/lib/utils/donna128.h +index f39f57f97..ab7fb4c83 100644 +--- a/src/lib/utils/donna128.h ++++ b/src/lib/utils/donna128.h +@@ -8,6 +8,7 @@ + #ifndef BOTAN_CURVE25519_DONNA128_H_ + #define BOTAN_CURVE25519_DONNA128_H_ + ++#include <botan/internal/ct_utils.h> + #include <botan/internal/mul128.h> + + namespace Botan { +@@ -54,14 +55,14 @@ class donna128 final { + l += x.l; + h += x.h; + +- const uint64_t carry = (l < x.l); ++ const uint64_t carry = CT::Mask<uint64_t>::is_lt(l, x.l).if_set_return(1); + h += carry; + return *this; + } + + donna128& operator+=(uint64_t x) { + l += x; +- const uint64_t carry = (l < x); ++ const uint64_t carry = CT::Mask<uint64_t>::is_lt(l, x).if_set_return(1); + h += carry; + return *this; + } +diff --git a/src/lib/utils/ghash/ghash.cpp b/src/lib/utils/ghash/ghash.cpp +index 38604afdb..5c244b4f8 100644 +--- a/src/lib/utils/ghash/ghash.cpp ++++ b/src/lib/utils/ghash/ghash.cpp +@@ -129,7 +129,7 @@ void GHASH::key_schedule(std::span<const uint8_t> key) { + m_HM[4 * j + 2 * i + 1] = H1; + + // GCM's bit ops are reversed so we carry out of the bottom +- const uint64_t carry = R * (H1 & 1); ++ const uint64_t carry = CT::Mask<uint64_t>::expand(H1 & 1).if_set_return(R); + H1 = (H1 >> 1) | (H0 << 63); + H0 = (H0 >> 1) ^ carry; + }
meta-oe/recipes-crypto/botan/botan_3.2.0.bb +1 -0
@@ -6,6 +6,7 @@ SECTION = "libs" SRC_URI = "https://botan.randombit.net/releases/Botan-${PV}.tar.xz \ file://CVE-2024-34703.patch \ + file://CVE-2024-50382-and-CVE-2024-50383.patch \ " SRC_URI[sha256sum] = "049c847835fcf6ef3a9e206b33de05dd38999c325e247482772a5598d9e5ece3"
PATCH 3/5 freerdp3: patch CVE-2025-4478
In reply to [email protected]From: Ankur Tyagi <[email protected]>
Details https://nvd.nist.gov/vuln/detail/CVE-2025-4478
--- .../freerdp/freerdp3/CVE-2025-4478.patch | 60 +++++++++++++++++++ .../recipes-support/freerdp/freerdp3_3.4.0.bb | 1 + 2 files changed, 61 insertions(+) create mode 100644 meta-oe/recipes-support/freerdp/freerdp3/CVE-2025-4478.patch
meta-oe/recipes-support/freerdp/freerdp3/CVE-2025-4478.patch new file +60 -0
@@ -0,0 +1,60 @@ +From 36cd5554b50656f3492197f0fc02534dcc6b980f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= <[email protected]> +Date: Tue, 13 May 2025 10:34:08 +0200 +Subject: [PATCH] transport: Initialize function pointers after resource + allocation + +The transport instance is freed when an error occurs. +If the TransportDisconnect function pointer is initialized it +causes SIGSEGV during free. + +CVE: CVE-2025-4478 +Upstream-Status: Backport [https://github.com/FreeRDP/FreeRDP/commit/a4bb702aa62e4fad91ca99142de075265555ec18] +(cherry picked from commit a4bb702aa62e4fad91ca99142de075265555ec18) +Signed-off-by: Ankur Tyagi <[email protected]> +--- + libfreerdp/core/transport.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c +index a2a899b79..552a28a60 100644 +--- a/libfreerdp/core/transport.c ++++ b/libfreerdp/core/transport.c +@@ -1560,18 +1560,6 @@ rdpTransport* transport_new(rdpContext* context) + if (!transport->log) + goto fail; + +- // transport->io.DataHandler = transport_data_handler; +- transport->io.TCPConnect = freerdp_tcp_default_connect; +- transport->io.TLSConnect = transport_default_connect_tls; +- transport->io.TLSAccept = transport_default_accept_tls; +- transport->io.TransportAttach = transport_default_attach; +- transport->io.TransportDisconnect = transport_default_disconnect; +- transport->io.ReadPdu = transport_default_read_pdu; +- transport->io.WritePdu = transport_default_write; +- transport->io.ReadBytes = transport_read_layer; +- transport->io.GetPublicKey = transport_default_get_public_key; +- transport->io.SetBlockingMode = transport_default_set_blocking_mode; +- + transport->context = context; + transport->ReceivePool = StreamPool_New(TRUE, BUFFER_SIZE); + +@@ -1610,6 +1598,18 @@ rdpTransport* transport_new(rdpContext* context) + if (!InitializeCriticalSectionAndSpinCount(&(transport->WriteLock), 4000)) + goto fail; + ++ // transport->io.DataHandler = transport_data_handler; ++ transport->io.TCPConnect = freerdp_tcp_default_connect; ++ transport->io.TLSConnect = transport_default_connect_tls; ++ transport->io.TLSAccept = transport_default_accept_tls; ++ transport->io.TransportAttach = transport_default_attach; ++ transport->io.TransportDisconnect = transport_default_disconnect; ++ transport->io.ReadPdu = transport_default_read_pdu; ++ transport->io.WritePdu = transport_default_write; ++ transport->io.ReadBytes = transport_read_layer; ++ transport->io.GetPublicKey = transport_default_get_public_key; ++ transport->io.SetBlockingMode = transport_default_set_blocking_mode; ++ + return transport; + fail: + WINPR_PRAGMA_DIAG_PUSH
meta-oe/recipes-support/freerdp/freerdp3_3.4.0.bb +1 -0
@@ -19,6 +19,7 @@ SRC_URI = "git://github.com/FreeRDP/FreeRDP.git;branch=master;protocol=https \ file://CVE-2024-32660.patch \ file://CVE-2024-32661.patch \ file://CVE-2024-32662.patch \ + file://CVE-2025-4478.patch \ " S = "${WORKDIR}/git"
PATCH 4/5 hdf5: patch CVE-2025-2926
In reply to [email protected]From: Ankur Tyagi <[email protected]>
Details https://nvd.nist.gov/vuln/detail/CVE-2025-2926
--- .../hdf5/files/CVE-2025-2926.patch | 32 +++++++++++++++++++ meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta-oe/recipes-support/hdf5/files/CVE-2025-2926.patch
meta-oe/recipes-support/hdf5/files/CVE-2025-2926.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 6680a7795b76d451ff17f193e5cdca7a86b01699 Mon Sep 17 00:00:00 2001 +From: bmribler <[email protected]> +Date: Mon, 3 Nov 2025 13:01:04 -0500 +Subject: [PATCH] Fix CVE-2025-2926 (#5841) + +An image size was corrupted and decoded as 0 resulting in a NULL image buffer, +which caused a NULL pointer dereference when the image being copied to the buffer. +The invalid image size was caught in the PR #5710. This change catches right +before the copying. + +Fixes GH issue #5384 + +CVE: CVE-2025-2926 +Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/d37b537ff256f0fa65cb4f82b20f286ad9a2e1e2] +(cherry picked from commit d37b537ff256f0fa65cb4f82b20f286ad9a2e1e2) +Signed-off-by: Ankur Tyagi <[email protected]> +--- + src/H5Ocache.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/H5Ocache.c b/src/H5Ocache.c +index 6916a9044c..9b82509812 100644 +--- a/src/H5Ocache.c ++++ b/src/H5Ocache.c +@@ -610,6 +610,7 @@ H5O__cache_chk_get_initial_load_size(void *_udata, size_t *image_len) + assert(udata); + assert(udata->oh); + assert(image_len); ++ assert(udata->size); + + /* Set the image length size */ + *image_len = udata->size;
meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb +1 -0
@@ -23,6 +23,7 @@ SRC_URI = " \ file://CVE-2025-2925.patch \ file://CVE-2025-6269-CVE-2025-6270-CVE-2025-6516_01.patch \ file://CVE-2025-6269-CVE-2025-6270-CVE-2025-6516_02.patch \ + file://CVE-2025-2926.patch \ " SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03"
PATCH 5/5 iptraf-ng: patch CVE-2024-52949
In reply to [email protected]From: Gyorgy Sarvari <[email protected]>
Details: https://nvd.nist.gov/vuln/detail/CVE-2024-52949
Pick the commit that mentions the CVE in its description.
--- .../iptraf/iptraf-ng/CVE-2024-52949.patch | 218 ++++++++++++++++++ .../iptraf/iptraf-ng_1.2.1.bb | 1 + 2 files changed, 219 insertions(+) create mode 100644 meta-oe/recipes-devtools/iptraf/iptraf-ng/CVE-2024-52949.patch
meta-oe/recipes-devtools/iptraf/iptraf-ng/CVE-2024-52949.patch new file +218 -0
@@ -0,0 +1,218 @@ +From 6a35a7f68c2dd946c5092376d71bbf0b925e2c4e Mon Sep 17 00:00:00 2001 +From: Vitezslav Samel <[email protected]> +Date: Thu, 21 Nov 2024 08:43:57 +0100 +Subject: [PATCH] interface names: limit length to IFNAMSIZ + +This fixes CVE-2024-52949 (stack based buffer overflow) +when copying user supplied interface name without any +check. + +Problem was reported by Massimiliano Ferraresi and Massimiliano Brolli +from TIM Red team (https://www.gruppotim.it/it/footer/red-team.html) + +CVE: CVE-2024-52949 +Upstream-Status: Backport [https://github.com/iptraf-ng/iptraf-ng/commit/2b623e991115358a57275af8a53feb5ae707b3ae] + +Reported-by: Massimiliano Ferraresi, Massimiliano Brolli +Signed-off-by: Vitezslav Samel <[email protected]> +--- + src/ifaces.c | 16 ++++++++-------- + src/ifstats.c | 6 +++--- + src/iptraf-ng-compat.h | 1 + + src/iptraf.c | 9 +++++++++ + src/othptab.c | 2 +- + src/promisc.c | 2 +- + src/tcptable.c | 4 ++-- + src/wrapper.c | 8 ++++++++ + 8 files changed, 33 insertions(+), 15 deletions(-) + +diff --git a/src/ifaces.c b/src/ifaces.c +index aeb1614..4c5a545 100644 +--- a/src/ifaces.c ++++ b/src/ifaces.c +@@ -67,7 +67,7 @@ int dev_up(char *iface) + + fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); + +- strcpy(ifr.ifr_name, iface); ++ ifname_copy(ifr.ifr_name, iface); + ir = ioctl(fd, SIOCGIFFLAGS, &ifr); + + close(fd); +@@ -90,7 +90,7 @@ int dev_get_ifindex(const char *iface) + return fd; + + struct ifreq ifr; +- strcpy(ifr.ifr_name, iface); ++ ifname_copy(ifr.ifr_name, iface); + int ir = ioctl(fd, SIOCGIFINDEX, &ifr); + + /* need to preserve errno across call to close() */ +@@ -114,7 +114,7 @@ int dev_get_mtu(const char *iface) + return fd; + + struct ifreq ifr; +- strcpy(ifr.ifr_name, iface); ++ ifname_copy(ifr.ifr_name, iface); + int ir = ioctl(fd, SIOCGIFMTU, &ifr); + + /* need to preserve errno across call to close() */ +@@ -138,7 +138,7 @@ int dev_get_flags(const char *iface) + return fd; + + struct ifreq ifr; +- strcpy(ifr.ifr_name, iface); ++ ifname_copy(ifr.ifr_name, iface); + int ir = ioctl(fd, SIOCGIFFLAGS, &ifr); + + /* need to preserve errno across call to close() */ +@@ -162,7 +162,7 @@ int dev_set_flags(const char *iface, int flags) + return fd; + + struct ifreq ifr; +- strcpy(ifr.ifr_name, iface); ++ ifname_copy(ifr.ifr_name, iface); + int ir = ioctl(fd, SIOCGIFFLAGS, &ifr); + if (ir == -1) + goto err; +@@ -190,7 +190,7 @@ int dev_clear_flags(const char *iface, int flags) + return fd; + + struct ifreq ifr; +- strcpy(ifr.ifr_name, iface); ++ ifname_copy(ifr.ifr_name, iface); + int ir = ioctl(fd, SIOCGIFFLAGS, &ifr); + if (ir == -1) + goto err; +@@ -233,7 +233,7 @@ int dev_get_ifname(int ifindex, char *ifname) + return ir; + } + +- strncpy(ifname, ifr.ifr_name, IFNAMSIZ); ++ ifname_copy(ifname, ifr.ifr_name); + return ir; + } + +@@ -256,7 +256,7 @@ int dev_bind_ifname(int fd, const char * const ifname) + int ir; + struct ifreq ifr; + +- strcpy(ifr.ifr_name, ifname); ++ ifname_copy(ifr.ifr_name, ifname); + ir = ioctl(fd, SIOCGIFINDEX, &ifr); + if (ir) + return ir; +diff --git a/src/ifstats.c b/src/ifstats.c +index 00a2a3f..1b687b6 100644 +--- a/src/ifstats.c ++++ b/src/ifstats.c +@@ -194,7 +194,7 @@ static void initiflist(struct iflist **list) + + struct iflist *itmp = alloc_iflist_entry(); + itmp->ifindex = ifindex; +- strcpy(itmp->ifname, ifname); ++ ifname_copy(itmp->ifname, ifname); + + /* make the linked list sorted by ifindex */ + struct iflist *cur = *list, *last = NULL; +@@ -714,9 +714,9 @@ void selectiface(char *ifname, int withall, int *aborted) + if (!(*aborted) && (list != NULL)) { + ptmp = (struct iflist *) scrolllist.textptr->nodeptr; + if ((withall) && (ptmp->prev_entry == NULL)) /* All Interfaces */ +- strcpy(ifname, ""); ++ ifname_copy(ifname, ""); + else +- strcpy(ifname, ptmp->ifname); ++ ifname_copy(ifname, ptmp->ifname); + } + + tx_destroy_list(&scrolllist); +diff --git a/src/iptraf-ng-compat.h b/src/iptraf-ng-compat.h +index 5aec185..845f18b 100644 +--- a/src/iptraf-ng-compat.h ++++ b/src/iptraf-ng-compat.h +@@ -112,6 +112,7 @@ extern void *xmallocz(size_t size); + extern char *xstrdup(const char *s); + extern int strtoul_ui(char const *s, int base, unsigned int *result); + extern int strtol_i(char const *s, int base, int *result); ++extern void ifname_copy(char *dst, const char *src); + + extern void die(const char *err, ...) __noreturn __printf(1,2); + extern void die_errno(const char *fmt, ...) __noreturn __printf(1,2); +diff --git a/src/iptraf.c b/src/iptraf.c +index 95f8e53..e5dcb64 100644 +--- a/src/iptraf.c ++++ b/src/iptraf.c +@@ -388,6 +388,15 @@ int main(int argc, char **argv) + if (__builtin_popcount(command) > 1) + die("only one of -i|-d|-s|-z|-l|-g options must be used"); + ++ /* sanity check of passed arguments */ ++ if ((i_opt && strlen(i_opt) >= IFNAMSIZ) || ++ (d_opt && strlen(d_opt) >= IFNAMSIZ) || ++ (s_opt && strlen(s_opt) >= IFNAMSIZ) || ++ (z_opt && strlen(z_opt) >= IFNAMSIZ) || ++ (l_opt && strlen(l_opt) >= IFNAMSIZ)) { ++ die("interface name is too long"); ++ } ++ + strcpy(current_logfile, ""); + + if (f_opt) { +diff --git a/src/othptab.c b/src/othptab.c +index d1d9658..80f3dc8 100644 +--- a/src/othptab.c ++++ b/src/othptab.c +@@ -271,7 +271,7 @@ struct othptabent *add_othp_entry(struct othptable *table, struct pkt_hdr *pkt, + } + + new_entry->protocol = protocol; +- strcpy(new_entry->iface, ifname); ++ ifname_copy(new_entry->iface, ifname); + + new_entry->pkt_length = pkt->pkt_len; + +diff --git a/src/promisc.c b/src/promisc.c +index d94e8bb..4737962 100644 +--- a/src/promisc.c ++++ b/src/promisc.c +@@ -70,7 +70,7 @@ static void promisc_enable_dev(struct list_head *promisc, int sock, const char * + struct promisc_list *new = xmallocz(sizeof(*new)); + + new->ifindex = ifindex; +- strcpy(new->ifname, dev); ++ ifname_copy(new->ifname, dev); + list_add_tail(&new->list, promisc); + } + +diff --git a/src/tcptable.c b/src/tcptable.c +index 159d628..2c4efc1 100644 +--- a/src/tcptable.c ++++ b/src/tcptable.c +@@ -365,8 +365,8 @@ struct tcptableent *addentry(struct tcptable *table, + * Store interface name + */ + +- strcpy(new_entry->ifname, ifname); +- strcpy(new_entry->oth_connection->ifname, ifname); ++ ifname_copy(new_entry->ifname, ifname); ++ ifname_copy(new_entry->oth_connection->ifname, ifname); + + /* + * Zero out MAC address fields +diff --git a/src/wrapper.c b/src/wrapper.c +index 2eb3b59..1d2dc6f 100644 +--- a/src/wrapper.c ++++ b/src/wrapper.c +@@ -78,3 +78,11 @@ int strtol_i(char const *s, int base, int *result) + *result = ul; + return 0; + } ++ ++/* it's up to the caller to ensure there is room for */ ++/* at least IFNAMSIZ bytes in dst */ ++void ifname_copy(char *dst, const char *src) ++{ ++ strncpy(dst, src, IFNAMSIZ - 1); ++ dst[IFNAMSIZ - 1] = '\0'; ++}
meta-oe/recipes-devtools/iptraf/iptraf-ng_1.2.1.bb +1 -0
@@ -28,6 +28,7 @@ SRC_URI = "https://src.fedoraproject.org/repo/pkgs/iptraf-ng/v${PV}.tar.gz/sha51 file://iptraf-ng-tmpfiles.conf \ file://ncurses-config.patch \ file://0001-make-Make-CC-weak-assignment.patch \ + file://CVE-2024-52949.patch \ " SRC_URI[sha256sum] = "9f5cef584065420dea1ba32c86126aede1fa9bd25b0f8362b0f9fd9754f00870"