diff options
author | Yogita Urade <yogita.urade@windriver.com> | 2025-05-13 17:16:12 +0530 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2025-05-25 14:48:44 -0400 |
commit | 45bddd258a3d1ded925faf8389e01bb948dc7f5b (patch) | |
tree | e8c7a71017428bb56fe965ff5163e806a7a17c9d | |
parent | 5c4b61d38a86de2c26f4ce5e57aaa169643ac211 (diff) | |
download | meta-openembedded-kirkstone-next.tar.gz |
poppler: fix CVE-2025-43903kirkstone-nextkirkstone
NSSCryptoSignBackend.cc in Poppler before 25.04.0 does not
verify the adbe.pkcs7.sha1 signatures on documents, resulting
in potential signature forgeries.
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2025-43903
Upstream patch:
https://gitlab.freedesktop.org/poppler/poppler/-/commit/f1b9c830f145a0042e853d6462b2f9ca4016c669
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | meta-oe/recipes-support/poppler/poppler/CVE-2025-43903.patch | 54 | ||||
-rw-r--r-- | meta-oe/recipes-support/poppler/poppler_22.04.0.bb | 1 |
2 files changed, 55 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/poppler/poppler/CVE-2025-43903.patch b/meta-oe/recipes-support/poppler/poppler/CVE-2025-43903.patch new file mode 100644 index 0000000000..e5acf7492b --- /dev/null +++ b/meta-oe/recipes-support/poppler/poppler/CVE-2025-43903.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From f1b9c830f145a0042e853d6462b2f9ca4016c669 Mon Sep 17 00:00:00 2001 | ||
2 | From: Juraj sarinay <juraj@sarinay.com> | ||
3 | Date: Thu, 6 Mar 2025 02:02:56 +0100 | ||
4 | Subject: [PATCH] Properly verify adbe.pkcs7.sha1 signatures. | ||
5 | |||
6 | For signatures with non-empty encapsulated content | ||
7 | (typically adbe.pkcs7.sha1), we only compared hash values and | ||
8 | never actually checked SignatureValue within SignerInfo. | ||
9 | The bug introduced by c7c0207b | ||
10 | made trivial signature forgeries possible. Fix this by calling | ||
11 | NSS_CMSSignerInfo_Verify() after the hash values compare equal. | ||
12 | |||
13 | CVE: CVE-2025-43903 | ||
14 | Upstream-Status: Backport [https://gitlab.freedesktop.org/poppler/poppler/-/commit/f1b9c830f145a0042e853d6462b2f9ca4016c669] | ||
15 | |||
16 | Changes: | ||
17 | - Refresh patch context as per the source code. | ||
18 | |||
19 | Signed-off-by: Yogita Urade <yogita.urade@windriver.com> | ||
20 | --- | ||
21 | poppler/SignatureHandler.cc | 13 ++++++++----- | ||
22 | 1 file changed, 8 insertions(+), 5 deletions(-) | ||
23 | |||
24 | diff --git a/poppler/SignatureHandler.cc b/poppler/SignatureHandler.cc | ||
25 | index 6538239..4008b2c 100644 | ||
26 | --- a/poppler/SignatureHandler.cc | ||
27 | +++ b/poppler/SignatureHandler.cc | ||
28 | @@ -969,16 +969,19 @@ SignatureValidationStatus SignatureHandler::validateSignature() | ||
29 | This means it's not a detached type signature | ||
30 | so the digest is contained in SignedData->contentInfo | ||
31 | */ | ||
32 | - if (memcmp(digest.data, content_info_data->data, hash_length) == 0 && digest.len == content_info_data->len) { | ||
33 | - PORT_Free(digest_buffer); | ||
34 | - return SIGNATURE_VALID; | ||
35 | - } else { | ||
36 | + if (digest.len != content_info_data->len || memcmp(digest.data, content_info_data->data, digest.len) != 0) { | ||
37 | PORT_Free(digest_buffer); | ||
38 | return SIGNATURE_DIGEST_MISMATCH; | ||
39 | } | ||
40 | |||
41 | - } else if (NSS_CMSSignerInfo_Verify(CMSSignerInfo, &digest, nullptr) != SECSuccess) { | ||
42 | + auto innerHashContext = HASH_Create(getHashAlgorithm()); | ||
43 | + HASH_Update(innerHashContext, content_info_data->data, content_info_data->len); | ||
44 | + HASH_End(innerHashContext, digest_buffer, &result_len, hash_length); | ||
45 | + digest.data = digest_buffer; | ||
46 | + digest.len = hash_length; | ||
47 | + } | ||
48 | |||
49 | + if (NSS_CMSSignerInfo_Verify(CMSSignerInfo, &digest, nullptr) != SECSuccess) { | ||
50 | PORT_Free(digest_buffer); | ||
51 | return NSS_SigTranslate(CMSSignerInfo->verificationStatus); | ||
52 | } else { | ||
53 | -- | ||
54 | 2.40.0 | ||
diff --git a/meta-oe/recipes-support/poppler/poppler_22.04.0.bb b/meta-oe/recipes-support/poppler/poppler_22.04.0.bb index 494308b8a5..bb6e64d657 100644 --- a/meta-oe/recipes-support/poppler/poppler_22.04.0.bb +++ b/meta-oe/recipes-support/poppler/poppler_22.04.0.bb | |||
@@ -13,6 +13,7 @@ SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \ | |||
13 | file://CVE-2024-56378.patch \ | 13 | file://CVE-2024-56378.patch \ |
14 | file://CVE-2025-32364.patch \ | 14 | file://CVE-2025-32364.patch \ |
15 | file://CVE-2025-32365.patch \ | 15 | file://CVE-2025-32365.patch \ |
16 | file://CVE-2025-43903.patch \ | ||
16 | " | 17 | " |
17 | SRC_URI[sha256sum] = "813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff" | 18 | SRC_URI[sha256sum] = "813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff" |
18 | 19 | ||