Closed Bug 1495451 Opened 6 years ago Closed 6 years ago

use-after-free in tls13_CopyKeyShareEntry

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(firefox-esr60 unaffected, firefox62 unaffected, firefox63 unaffected, firefox64- unaffected)

RESOLVED FIXED
Tracking Status
firefox-esr60 --- unaffected
firefox62 --- unaffected
firefox63 --- unaffected
firefox64 - unaffected

People

(Reporter: dveditz, Assigned: ekr)

References

Details

(Keywords: csectype-uaf, sec-high)

Attachments

(1 file)

Coverity reports a use-after-free in tls13_CopyKeyShareEntry. Looks like a missing "return NULL" after the free. *** CID 1439842: Memory - corruptions (USE_AFTER_FREE) /security/nss/lib/ssl/tls13con.c: 3453 in tls13_CopyKeyShareEntry() 3447 return NULL; 3448 } 3449 3450 if (SECSuccess != SECITEM_CopyItem(NULL, &n->key_exchange, &o->key_exchange)) { 3451 PORT_Free(n); 3452 } >>> CID 1439842: Memory - corruptions (USE_AFTER_FREE) >>> Dereferencing freed pointer "n". 3453 n->group = o->group; 3454 return n; 3455 } 3456 3457 void 3458 tls13_DestroyKeyShareEntry(TLS13KeyShareEntry *offer)
Blocks: 1488622
Note there were several other minor(?) coverity notices (about an ignored rv = value, and such - likely minor or false-positives, but also worth checking). Sent via email to ekr & mt.
This is a nice catch. Fortunately it's not an issue in Firefox because we don't invoke this fxn. I'll produce a fix, though.
Comment on attachment 9013464 [details] Fix issues flagged by coverity Martin Thomson [:mt:] has approved the revision.
Attachment #9013464 - Flags: review+
Per comment 2, this doesn't need to be tracked on the Firefox side.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
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: