diff options
| author | Bhabu Bindu <bhabu.bindu@kpit.com> | 2023-05-29 17:02:43 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-06-01 16:24:07 -1000 |
| commit | 8f3b0b8e9bbff522c1dd9f1507d71c82d228c46e (patch) | |
| tree | 3d7fa2c7c9fef6de8590dd45d364a1b3913bb43b | |
| parent | 2afcf3e39f9016f590e597cee4b71166c982d58d (diff) | |
| download | poky-8f3b0b8e9bbff522c1dd9f1507d71c82d228c46e.tar.gz | |
curl: Fix CVE-2023-28319
Add patch to fix CVE-2023-28319
UAF in SSH sha256 fingerprint check
libcurl offers a feature to verify an SSH server's public key using
a SHA 256hash. When this check fails, libcurl would free the memory
for the fingerprintbefore it returns an error message containing the
(now freed) hash.
This flaw risks inserting sensitive heap-based data into the error
message that might be shown to users or otherwise get
leaked and revealed.
Link: https://curl.se/docs/CVE-2023-28319.html
(From OE-Core rev: f7d6751828683ac2adbf140e77dbf7454cfa8eb1)
Signed-off-by: Bhabu Bindu <bhabu.bindu@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-support/curl/curl/CVE-2023-28319.patch | 33 | ||||
| -rw-r--r-- | meta/recipes-support/curl/curl_7.82.0.bb | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-support/curl/curl/CVE-2023-28319.patch b/meta/recipes-support/curl/curl/CVE-2023-28319.patch new file mode 100644 index 0000000000..c0bca9a56e --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2023-28319.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From 8e21b1a05f3c0ee098dbcb6c3d84cb61f102a122 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Daniel Stenberg <daniel@haxx.se> | ||
| 3 | Date: Mon, 8 May 2023 14:33:54 +0200 | ||
| 4 | Subject: [PATCH] libssh2: free fingerprint better | ||
| 5 | |||
| 6 | Reported-by: Wei Chong Tan | ||
| 7 | Closes #11088 | ||
| 8 | |||
| 9 | CVE: CVE-2023-28319 | ||
| 10 | Upstream-Status: Backport [https://github.com/curl/curl/commit/8e21b1a05f3c0ee098dbcb6c] | ||
| 11 | Comments: Hunks Refreshed | ||
| 12 | Signed-off-by: Bhabu Bindu <bhabu.bindu@kpit.com> | ||
| 13 | --- | ||
| 14 | lib/vssh/libssh2.c | 3 +-- | ||
| 15 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c | ||
| 18 | index bfcc94e160178..dd39a844c646b 100644 | ||
| 19 | --- a/lib/vssh/libssh2.c | ||
| 20 | +++ b/lib/vssh/libssh2.c | ||
| 21 | @@ -695,11 +695,10 @@ | ||
| 22 | */ | ||
| 23 | if((pub_pos != b64_pos) || | ||
| 24 | Curl_strncasecompare(fingerprint_b64, pubkey_sha256, pub_pos) != 1) { | ||
| 25 | - free(fingerprint_b64); | ||
| 26 | - | ||
| 27 | failf(data, | ||
| 28 | "Denied establishing ssh session: mismatch sha256 fingerprint. " | ||
| 29 | "Remote %s is not equal to %s", fingerprint_b64, pubkey_sha256); | ||
| 30 | + free(fingerprint_b64); | ||
| 31 | state(data, SSH_SESSION_FREE); | ||
| 32 | sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; | ||
| 33 | return sshc->actualcode; | ||
diff --git a/meta/recipes-support/curl/curl_7.82.0.bb b/meta/recipes-support/curl/curl_7.82.0.bb index 70ceb9f370..e38bf14cc4 100644 --- a/meta/recipes-support/curl/curl_7.82.0.bb +++ b/meta/recipes-support/curl/curl_7.82.0.bb | |||
| @@ -45,6 +45,7 @@ SRC_URI = "https://curl.se/download/${BP}.tar.xz \ | |||
| 45 | file://CVE-2023-27535-pre1.patch \ | 45 | file://CVE-2023-27535-pre1.patch \ |
| 46 | file://CVE-2023-27535_and_CVE-2023-27538.patch \ | 46 | file://CVE-2023-27535_and_CVE-2023-27538.patch \ |
| 47 | file://CVE-2023-27536.patch \ | 47 | file://CVE-2023-27536.patch \ |
| 48 | file://CVE-2023-28319.patch \ | ||
| 48 | " | 49 | " |
| 49 | SRC_URI[sha256sum] = "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c" | 50 | SRC_URI[sha256sum] = "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c" |
| 50 | 51 | ||
