diff options
Diffstat (limited to 'meta/recipes-connectivity')
4 files changed, 136 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-1.patch b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-1.patch new file mode 100644 index 0000000000..d263cced8d --- /dev/null +++ b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-1.patch | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | From b8ee33667d265b936d60ee7f0ba0b22463ccb019 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ben Noordhuis <info@bnoordhuis.nl> | ||
| 3 | Date: Thu, 18 Jan 2024 14:51:40 +0100 | ||
| 4 | Subject: [PATCH] fix: always zero-terminate idna output | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/libuv/libuv/commit/0f2d7e784a256b54b2385043438848047bc2a629] | ||
| 7 | CVE: CVE-2024-24806 | ||
| 8 | |||
| 9 | Fixes: https://github.com/libuv/libuv/security/advisories/GHSA-f74f-cvh7-c6q6 | ||
| 10 | Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com> | ||
| 11 | --- | ||
| 12 | src/idna.c | 5 +++-- | ||
| 13 | test/test-idna.c | 4 ++++ | ||
| 14 | 2 files changed, 7 insertions(+), 2 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/src/idna.c b/src/idna.c | ||
| 17 | index 93d982ca..ce7f2746 100644 | ||
| 18 | --- a/src/idna.c | ||
| 19 | +++ b/src/idna.c | ||
| 20 | @@ -308,8 +308,9 @@ long uv__idna_toascii(const char* s, const char* se, char* d, char* de) { | ||
| 21 | return rc; | ||
| 22 | } | ||
| 23 | |||
| 24 | - if (d < de) | ||
| 25 | - *d++ = '\0'; | ||
| 26 | + if (d >= de) | ||
| 27 | + return UV_EINVAL; | ||
| 28 | |||
| 29 | + *d++ = '\0'; | ||
| 30 | return d - ds; /* Number of bytes written. */ | ||
| 31 | } | ||
| 32 | diff --git a/test/test-idna.c b/test/test-idna.c | ||
| 33 | index f4fad965..d079be55 100644 | ||
| 34 | --- a/test/test-idna.c | ||
| 35 | +++ b/test/test-idna.c | ||
| 36 | @@ -99,6 +99,7 @@ TEST_IMPL(utf8_decode1) { | ||
| 37 | TEST_IMPL(utf8_decode1_overrun) { | ||
| 38 | const char* p; | ||
| 39 | char b[1]; | ||
| 40 | + char c[1]; | ||
| 41 | |||
| 42 | /* Single byte. */ | ||
| 43 | p = b; | ||
| 44 | @@ -112,6 +113,9 @@ TEST_IMPL(utf8_decode1_overrun) { | ||
| 45 | ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + 1)); | ||
| 46 | ASSERT_EQ(p, b + 1); | ||
| 47 | |||
| 48 | + b[0] = 0x7F; | ||
| 49 | + ASSERT_EQ(UV_EINVAL, uv__idna_toascii(b, b + 1, c, c + 1)); | ||
| 50 | + | ||
| 51 | return 0; | ||
| 52 | } | ||
| 53 | |||
| 54 | -- | ||
| 55 | 2.43.0 | ||
| 56 | |||
diff --git a/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-2.patch b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-2.patch new file mode 100644 index 0000000000..b0ed5f0ea2 --- /dev/null +++ b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-2.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | From 96f881c8f600da33ec4ecec450ec491990ce613b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ben Noordhuis <info@bnoordhuis.nl> | ||
| 3 | Date: Thu, 18 Jan 2024 14:52:38 +0100 | ||
| 4 | Subject: [PATCH] fix: reject zero-length idna inputs | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/libuv/libuv/commit/3530bcc30350d4a6ccf35d2f7b33e23292b9de70] | ||
| 7 | CVE: CVE-2024-24806 | ||
| 8 | |||
| 9 | Fixes: https://github.com/libuv/libuv/security/advisories/GHSA-f74f-cvh7-c6q6 | ||
| 10 | Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com> | ||
| 11 | --- | ||
| 12 | src/idna.c | 3 +++ | ||
| 13 | test/test-idna.c | 1 + | ||
| 14 | 2 files changed, 4 insertions(+) | ||
| 15 | |||
| 16 | diff --git a/src/idna.c b/src/idna.c | ||
| 17 | index ce7f2746..858b19d0 100644 | ||
| 18 | --- a/src/idna.c | ||
| 19 | +++ b/src/idna.c | ||
| 20 | @@ -274,6 +274,9 @@ long uv__idna_toascii(const char* s, const char* se, char* d, char* de) { | ||
| 21 | char* ds; | ||
| 22 | int rc; | ||
| 23 | |||
| 24 | + if (s == se) | ||
| 25 | + return UV_EINVAL; | ||
| 26 | + | ||
| 27 | ds = d; | ||
| 28 | |||
| 29 | si = s; | ||
| 30 | diff --git a/test/test-idna.c b/test/test-idna.c | ||
| 31 | index d079be55..d59b521e 100644 | ||
| 32 | --- a/test/test-idna.c | ||
| 33 | +++ b/test/test-idna.c | ||
| 34 | @@ -114,6 +114,7 @@ TEST_IMPL(utf8_decode1_overrun) { | ||
| 35 | ASSERT_EQ(p, b + 1); | ||
| 36 | |||
| 37 | b[0] = 0x7F; | ||
| 38 | + ASSERT_EQ(UV_EINVAL, uv__idna_toascii(b, b + 0, c, c + 1)); | ||
| 39 | ASSERT_EQ(UV_EINVAL, uv__idna_toascii(b, b + 1, c, c + 1)); | ||
| 40 | |||
| 41 | return 0; | ||
| 42 | -- | ||
| 43 | 2.43.0 | ||
| 44 | |||
diff --git a/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-3.patch b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-3.patch new file mode 100644 index 0000000000..733660cf05 --- /dev/null +++ b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-3.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From a7443ee6b3b3c6a12708148aa9bb001b7782905c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Santiago Gimeno <santiago.gimeno@gmail.com> | ||
| 3 | Date: Wed, 7 Feb 2024 20:27:58 +0100 | ||
| 4 | Subject: [PATCH] test: empty strings are not valid IDNA | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/libuv/libuv/commit/e0327e1d508b8207c9150b6e582f0adf26213c39] | ||
| 7 | CVE: CVE-2024-24806 | ||
| 8 | |||
| 9 | Fixes: https://github.com/libuv/libuv/security/advisories/GHSA-f74f-cvh7-c6q6 | ||
| 10 | Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com> | ||
| 11 | --- | ||
| 12 | test/test-idna.c | 2 +- | ||
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/test/test-idna.c b/test/test-idna.c | ||
| 16 | index d59b521e..37da38de 100644 | ||
| 17 | --- a/test/test-idna.c | ||
| 18 | +++ b/test/test-idna.c | ||
| 19 | @@ -150,8 +150,8 @@ TEST_IMPL(idna_toascii) { | ||
| 20 | /* Illegal inputs. */ | ||
| 21 | F("\xC0\x80\xC1\x80", UV_EINVAL); /* Overlong UTF-8 sequence. */ | ||
| 22 | F("\xC0\x80\xC1\x80.com", UV_EINVAL); /* Overlong UTF-8 sequence. */ | ||
| 23 | + F("", UV_EINVAL); | ||
| 24 | /* No conversion. */ | ||
| 25 | - T("", ""); | ||
| 26 | T(".", "."); | ||
| 27 | T(".com", ".com"); | ||
| 28 | T("example", "example"); | ||
| 29 | -- | ||
| 30 | 2.43.0 | ||
| 31 | |||
diff --git a/meta/recipes-connectivity/libuv/libuv_1.44.2.bb b/meta/recipes-connectivity/libuv/libuv_1.44.2.bb index 27e79276b5..e2cd3c3247 100644 --- a/meta/recipes-connectivity/libuv/libuv_1.44.2.bb +++ b/meta/recipes-connectivity/libuv/libuv_1.44.2.bb | |||
| @@ -6,7 +6,11 @@ LICENSE = "MIT" | |||
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=ad93ca1fffe931537fcf64f6fcce084d" | 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=ad93ca1fffe931537fcf64f6fcce084d" |
| 7 | 7 | ||
| 8 | SRCREV = "0c1fa696aa502eb749c2c4735005f41ba00a27b8" | 8 | SRCREV = "0c1fa696aa502eb749c2c4735005f41ba00a27b8" |
| 9 | SRC_URI = "git://github.com/libuv/libuv.git;branch=v1.x;protocol=https" | 9 | SRC_URI = "git://github.com/libuv/libuv.git;branch=v1.x;protocol=https \ |
| 10 | file://CVE-2024-24806-1.patch \ | ||
| 11 | file://CVE-2024-24806-2.patch \ | ||
| 12 | file://CVE-2024-24806-3.patch \ | ||
| 13 | " | ||
| 10 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" | 14 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" |
| 11 | 15 | ||
| 12 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
