Closed Bug 1330271 Opened 9 years ago Closed 3 years ago

Assertion failure: theTemplate->sub != NULL, at ../../lib/util/secasn1u.c:56

Categories

(NSS :: Libraries, defect, P2)

defect

Tracking

(firefox-esr91 wontfix, firefox-esr102104+ fixed, firefox103 wontfix, firefox104 wontfix, firefox105 fixed)

RESOLVED FIXED
Tracking Status
firefox-esr91 --- wontfix
firefox-esr102 104+ fixed
firefox103 --- wontfix
firefox104 --- wontfix
firefox105 --- fixed

People

(Reporter: ttaubert, Assigned: jschanck)

References

(Blocks 2 open bugs)

Details

(4 keywords, Whiteboard: [adv-esr102.2-] [post-critsmash-triage][adv-main105-])

Attachments

(2 files)

Assertion failure: theTemplate->sub != NULL, at ../../lib/util/secasn1u.c:56 ==29269== ERROR: libFuzzer: deadly signal #0 0x4cd590 in __sanitizer_print_stack_trace (/home/worker/dist/Debug/bin/nssfuzz-pkcs8+0x4cd590) #1 0x5139ea in fuzzer::Fuzzer::CrashCallback() /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:277:5 #2 0x513972 in fuzzer::Fuzzer::StaticCrashSignalCallback() /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:261:6 #3 0x5501c8 in fuzzer::CrashHandler(int, siginfo_t*, void*) /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerUtilPosix.cpp:37:3 #4 0x7fcddb3e938f (/lib/x86_64-linux-gnu/libpthread.so.0+0x1138f) #5 0x7fcddae40427 in gsignal /build/glibc-t3gR2i/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54 #6 0x7fcddae42029 in abort /build/glibc-t3gR2i/glibc-2.23/stdlib/abort.c:89 #7 0x7fcdda6bccf9 in PR_Assert /home/worker/nspr/Debug/pr/src/io/../../../../pr/src/io/prlog.c:553:5 #8 0x7fcddb9d4909 in SEC_ASN1GetSubtemplate /home/worker/nss/out/Debug/../../lib/util/secasn1u.c:56:5 #9 0x7fcddb9c15ff in sec_asn1d_prepare_for_contents /home/worker/nss/out/Debug/../../lib/util/secasn1d.c:1122:20 #10 0x7fcddb9bec5e in SEC_ASN1DecoderUpdate_Util /home/worker/nss/out/Debug/../../lib/util/secasn1d.c:2788:17 #11 0x4f8198 in LLVMFuzzerTestOneInput /home/worker/nss/out/Debug/../../fuzz/pkcs8_target.cc:130:11 #12 0x5169d0 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:549:13 #13 0x5171c8 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long) /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:500:3 #14 0x51a70a in fuzzer::Fuzzer::MutateAndTestOne() /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:756:30 #15 0x51b1b4 in fuzzer::Fuzzer::Loop() /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:790:5 #16 0x4ff2c8 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerDriver.cpp:536:6 #17 0x4f8733 in main /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerMain.cpp:20:10 #18 0x7fcddae2b82f in __libc_start_main /build/glibc-t3gR2i/glibc-2.23/csu/../csu/libc-start.c:291 #19 0x41ede8 in _start (/home/worker/dist/Debug/bin/nssfuzz-pkcs8+0x41ede8)
Looks like this would lead to a null deref crash, but not otherwise be exploitable?
Flags: needinfo?(ttaubert)
We're not always dereferencing if we take the branch on line 68. The problem is that I can't really say whether we alter the ASN.1 state in some way that it might be exploitable. This code is horrible and complex...
Flags: needinfo?(ttaubert)
Priority: -- → P2

Some of our dynamic template choosers, e.g. sec_pkcs12_choose_attr_type, can
return NULL. This patch adds some defensive checks to avoid crashes when
they do.

Assignee: nobody → jschanck
Group: crypto-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.82
Whiteboard: [adv-esr102.2-]
Flags: qe-verify-
Whiteboard: [adv-esr102.2-] → [adv-esr102.2-] [post-critsmash-triage]
Whiteboard: [adv-esr102.2-] [post-critsmash-triage] → [adv-esr102.2-] [post-critsmash-triage][adv-main105-]
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: