Closed Bug 1893752 Opened 1 year ago Closed 1 year ago

Use of uninitialized variables on error in ckcapi_getContainer()

Categories

(NSS :: Libraries, defect, P3)

Tracking

(firefox-esr115 wontfix, firefox125 wontfix, firefox126 wontfix, firefox127 fixed)

RESOLVED FIXED
Tracking Status
firefox-esr115 --- wontfix
firefox125 --- wontfix
firefox126 --- wontfix
firefox127 --- fixed

People

(Reporter: mozillabugs, Assigned: jschanck)

References

Details

(Keywords: reporter-external, sec-other, Whiteboard: [post-critsmash-triage][adv-main127-])

Attachments

(1 file)

ckcapi_getContainer() (nss/lib/ckfw/capi/cobject.c) will use uninitialized variables if UuidCreate() (line 1865) and/or UuidToString() (line 1866) fail.

UuidCreate() can fail if the machine lacks a usable ethernet address (https://learn.microsoft.com/en-us/windows/win32/api/rpcdce/nf-rpcdce-uuidcreate ) , as could happen if the ethernet adapter falls offline for some reason. UuidToString() can fail on OOM of some private pool inside Windows, since you must free its result with RpcStringFree() (https://learn.microsoft.com/en-us/windows/win32/api/rpcdce/nf-rpcdce-uuidtostring ).

These bugs appear latent in Firefox, as this function isn't built into FF v124.0.2. Presumably it can affect other code using NSS.

From FIREFOX_124_0_2_RELEASE:

1855: static char *
1856: ckcapi_getContainer(
1857:     CK_RV *pError,
1858:     NSSItem *id)
1859: {
1860:     RPC_STATUS rstat;
1861:     UUID uuid;
1862:     char *uuidStr;
1863:     char *container;
1864: 
1865:     rstat = UuidCreate(&uuid);
1866:     rstat = UuidToString(&uuid, &uuidStr);
1867: 
1868:     /* convert it from rcp memory to our own */
1869:     container = nssUTF8_Duplicate(uuidStr, NULL);
1870:     RpcStringFree(&uuidStr);
1871: 
1872:     return container;
1873: }
Flags: sec-bounty?

I suspect that no one has built this code since 2009 (Bug 494302). Let's just delete it.

Assignee: nobody → jschanck
Severity: -- → S4
Status: NEW → ASSIGNED
Priority: -- → P3
See Also: → 1464224
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Flags: sec-bounty? → sec-bounty-
Group: crypto-core-security → core-security-release
Flags: qe-verify-
Whiteboard: [post-critsmash-triage]
Whiteboard: [post-critsmash-triage] → [post-critsmash-triage][adv-main127-]
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: