Closed Bug 1203229 Opened 11 years ago Closed 10 years ago

UBSan: member access within null pointer of type 'SEC_PKCS7EncryptedData' in p7decode.c

Categories

(NSS :: Libraries, defect)

x86_64
Unspecified
defect
Not set
normal

Tracking

(firefox43 affected)

RESOLVED FIXED
Tracking Status
firefox43 --- affected

People

(Reporter: tsmith, Assigned: franziskus)

References

(Blocks 1 open bug)

Details

(Keywords: sec-low)

Attachments

(1 file)

This was found by building NSS with UBSan and running the test suite. p7decode.c:877:32: runtime error: member access within null pointer of type 'SEC_PKCS7EncryptedData' (aka 'struct SEC_PKCS7EncryptedDataStr')
p7decode.c:877:32: runtime error: member access within null pointer of type 'SEC_PKCS7EncryptedData' (aka 'struct SEC_PKCS7EncryptedDataStr') #0 0x7fa1568d9fab in sec_pkcs7_decoder_notify /home/user/code/san_nss/nss/lib/pkcs7/p7decode.c:877:32 #1 0x7fa155228978 in sec_asn1d_notify_before /home/user/code/san_nss/nss/lib/util/secasn1d.c:417:5 #2 0x7fa1552146c9 in sec_asn1d_next_in_sequence /home/user/code/san_nss/nss/lib/util/secasn1d.c:2149:2 #3 0x7fa1551f82ab in SEC_ASN1DecoderUpdate_Util /home/user/code/san_nss/nss/lib/util/secasn1d.c:2801:6 #4 0x7fa1568db0ac in SEC_PKCS7DecoderUpdate /home/user/code/san_nss/nss/lib/pkcs7/p7decode.c:1032:10 #5 0x7fa1568a8a2f in sec_pkcs12_decoder_wrap_p7_update /home/user/code/san_nss/nss/lib/pkcs12/p12d.c:751:5 #6 0x7fa1551f9aba in SEC_ASN1DecoderUpdate_Util /home/user/code/san_nss/nss/lib/util/secasn1d.c:2915:6 #7 0x7fa1568a4e71 in sec_pkcs12_decoder_asafes_callback /home/user/code/san_nss/nss/lib/pkcs12/p12d.c:842:10 #8 0x7fa1568ec0f4 in sec_pkcs7_decoder_work_data /home/user/code/san_nss/nss/lib/pkcs7/p7decode.c:173:6 #9 0x7fa1568e92c3 in sec_pkcs7_decoder_filter /home/user/code/san_nss/nss/lib/pkcs7/p7decode.c:217:5 #10 0x7fa1551f9aba in SEC_ASN1DecoderUpdate_Util /home/user/code/san_nss/nss/lib/util/secasn1d.c:2915:6 #11 0x7fa1568db0ac in SEC_PKCS7DecoderUpdate /home/user/code/san_nss/nss/lib/pkcs7/p7decode.c:1032:10 #12 0x7fa1568a35a8 in sec_pkcs12_decode_asafes_cinfo_update /home/user/code/san_nss/nss/lib/pkcs12/p12d.c:945:10 #13 0x7fa1551f9aba in SEC_ASN1DecoderUpdate_Util /home/user/code/san_nss/nss/lib/util/secasn1d.c:2915:6 #14 0x7fa15688f097 in SEC_PKCS12DecoderUpdate /home/user/code/san_nss/nss/lib/pkcs12/p12d.c:1277:10 #15 0x4e417a in p12U_ReadPKCS12File /home/user/code/san_nss/nss/cmd/pk12util/pk12util.c:404:14 #16 0x4e59d4 in P12U_ImportPKCS12Object /home/user/code/san_nss/nss/cmd/pk12util/pk12util.c:484:14 #17 0x4ed63d in main /home/user/code/san_nss/nss/cmd/pk12util/pk12util.c:1077:2 #18 0x7fa153fd1ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287 #19 0x41c495 in _start (/home/user/code/san_nss/nss/cmd/pk12util/Linux3.16_x86_64_clang-3.7_glibc_PTH_64_DBG.OBJ/pk12util+0x41c495)
The command leading to this failure was: pk12util -i ../stapling/ca.p12 -k ../tests.pw -w ../tests.pw -d ../stapling
This sounds like it is just a null-deref, so I'm marking it sec-low.
Keywords: sec-low
this patch should solve the error. Tyson can you confirm this?
Assignee: nobody → franziskuskiefer
Attachment #8742004 - Flags: feedback?(twsmith)
Looks good. I am no longer seeing this issue on the latest revision.
Comment on attachment 8742004 [details] [diff] [review] p7decode-null.patch Review of attachment 8742004 [details] [diff] [review]: ----------------------------------------------------------------- Re-tested without patch on the latest revision and this bug was still present. After applying patch and re-testing the issues was no longer reproducible.
Attachment #8742004 - Flags: feedback?(twsmith) → feedback+
Comment on attachment 8742004 [details] [diff] [review] p7decode-null.patch Tim can you review this? It adds some obvious null checks.
Attachment #8742004 - Flags: review?(ttaubert)
Attachment #8742004 - Flags: review?(ttaubert) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.25
Group: crypto-core-security → core-security-release
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: