diff options
| author | Sakib Sajal <sakib.sajal@windriver.com> | 2022-03-01 14:12:10 -0500 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2022-04-02 10:37:03 -0700 |
| commit | d5358492144ca70e4909c2f4e37da8606986698d (patch) | |
| tree | e496429a3fa7f516845cf80ef8ccab69d6fb671e | |
| parent | 923ceab6d71d06f4bddaab36201928e19ae89e06 (diff) | |
| download | meta-openembedded-d5358492144ca70e4909c2f4e37da8606986698d.tar.gz | |
nss: fix CVE-2022-22747
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
| -rw-r--r-- | meta-oe/recipes-support/nss/nss/0001-Bug-1735028-check-for-missing-signedData-field-r-kee.patch | 55 | ||||
| -rw-r--r-- | meta-oe/recipes-support/nss/nss_3.64.bb | 1 |
2 files changed, 56 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/nss/nss/0001-Bug-1735028-check-for-missing-signedData-field-r-kee.patch b/meta-oe/recipes-support/nss/nss/0001-Bug-1735028-check-for-missing-signedData-field-r-kee.patch new file mode 100644 index 0000000000..38b982b486 --- /dev/null +++ b/meta-oe/recipes-support/nss/nss/0001-Bug-1735028-check-for-missing-signedData-field-r-kee.patch | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | From 074e29e6724d443d3161ee2982ba7f017d3075dd Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "John M. Schanck" <jschanck@mozilla.com> | ||
| 3 | Date: Mon, 11 Oct 2021 22:09:25 +0000 | ||
| 4 | Subject: [PATCH] Bug 1735028 - check for missing signedData field r=keeler | ||
| 5 | |||
| 6 | Differential Revision: https://phabricator.services.mozilla.com/D128112 | ||
| 7 | |||
| 8 | Upstream-Status: Backport [074e29e6724d443d3161ee2982ba7f017d3075dd] | ||
| 9 | CVE: CVE-2022-22747 | ||
| 10 | Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> | ||
| 11 | --- | ||
| 12 | gtests/certdb_gtest/decode_certs_unittest.cc | 13 +++++++++++++ | ||
| 13 | lib/pkcs7/certread.c | 5 +++++ | ||
| 14 | 2 files changed, 18 insertions(+) | ||
| 15 | |||
| 16 | diff --git a/nss/gtests/certdb_gtest/decode_certs_unittest.cc b/nss/gtests/certdb_gtest/decode_certs_unittest.cc | ||
| 17 | index 405194edc..3317ae8ee 100644 | ||
| 18 | --- a/nss/gtests/certdb_gtest/decode_certs_unittest.cc | ||
| 19 | +++ b/nss/gtests/certdb_gtest/decode_certs_unittest.cc | ||
| 20 | @@ -26,3 +26,16 @@ TEST_F(DecodeCertsTest, EmptyCertPackage) { | ||
| 21 | sizeof(emptyCertPackage))); | ||
| 22 | EXPECT_EQ(SEC_ERROR_BAD_DER, PR_GetError()); | ||
| 23 | } | ||
| 24 | + | ||
| 25 | +TEST_F(DecodeCertsTest, EmptySignedData) { | ||
| 26 | + // This represents a PKCS#7 ContentInfo of contentType | ||
| 27 | + // 1.2.840.113549.1.7.2 (signedData) with missing content. | ||
| 28 | + unsigned char emptySignedData[] = {0x30, 0x80, 0x06, 0x09, 0x2a, 0x86, | ||
| 29 | + 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, | ||
| 30 | + 0x02, 0x00, 0x00, 0x05, 0x00}; | ||
| 31 | + | ||
| 32 | + EXPECT_EQ(nullptr, | ||
| 33 | + CERT_DecodeCertFromPackage(reinterpret_cast<char*>(emptySignedData), | ||
| 34 | + sizeof(emptySignedData))); | ||
| 35 | + EXPECT_EQ(SEC_ERROR_BAD_DER, PR_GetError()); | ||
| 36 | +} | ||
| 37 | diff --git a/nss/lib/pkcs7/certread.c b/nss/lib/pkcs7/certread.c | ||
| 38 | index 3091f9947..15094f2d7 100644 | ||
| 39 | --- a/nss/lib/pkcs7/certread.c | ||
| 40 | +++ b/nss/lib/pkcs7/certread.c | ||
| 41 | @@ -139,6 +139,11 @@ SEC_ReadPKCS7Certs(SECItem *pkcs7Item, CERTImportCertificateFunc f, void *arg) | ||
| 42 | goto done; | ||
| 43 | } | ||
| 44 | |||
| 45 | + if (contentInfo.content.signedData == NULL) { | ||
| 46 | + PORT_SetError(SEC_ERROR_BAD_DER); | ||
| 47 | + goto done; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | rv = SECSuccess; | ||
| 51 | |||
| 52 | certs = contentInfo.content.signedData->certificates; | ||
| 53 | -- | ||
| 54 | 2.25.1 | ||
| 55 | |||
diff --git a/meta-oe/recipes-support/nss/nss_3.64.bb b/meta-oe/recipes-support/nss/nss_3.64.bb index ccb5201d49..d16aec65d8 100644 --- a/meta-oe/recipes-support/nss/nss_3.64.bb +++ b/meta-oe/recipes-support/nss/nss_3.64.bb | |||
| @@ -33,6 +33,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${VERSIO | |||
| 33 | file://nss-fix-nsinstall-build.patch \ | 33 | file://nss-fix-nsinstall-build.patch \ |
| 34 | file://0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch \ | 34 | file://0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch \ |
| 35 | file://0001-Bug-1737470-Ensure-DER-encoded-signatures-are-within.patch \ | 35 | file://0001-Bug-1737470-Ensure-DER-encoded-signatures-are-within.patch \ |
| 36 | file://0001-Bug-1735028-check-for-missing-signedData-field-r-kee.patch \ | ||
| 36 | " | 37 | " |
| 37 | SRC_URI[sha256sum] = "d3175427172e9c3a6f1ebc74452cb791590f28191c6a1a443dbc0d87c9df1126" | 38 | SRC_URI[sha256sum] = "d3175427172e9c3a6f1ebc74452cb791590f28191c6a1a443dbc0d87c9df1126" |
| 38 | 39 | ||
