Closed Bug 1458122 Opened 7 years ago Closed 6 years ago

Potential double free bug in zonemeta.cpp (ICU4C)

Categories

(Core :: JavaScript: Internationalization API, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: pauljt, Assigned: anba)

References

Details

Semmle has detected a potential double free bug in zonemeta.cpp. The mzMappings variable is deleted on line 692, and again on line 706. From https://searchfox.org/mozilla-central/source/intl/icu/source/i18n/zonemeta.cpp#692 if (mzMappings == NULL) { mzMappings = new UVector(deleteOlsonToMetaMappingEntry, NULL, status); if (U_FAILURE(status)) { delete mzMappings; // mzMappings is deleted here uprv_free(entry); break; } } mzMappings->addElement(entry, status); if (U_FAILURE(status)) { break; } } ures_close(mz); if (U_FAILURE(status)) { if (mzMappings != NULL) { delete mzMappings; // we might try to delete mzMappings again I don't know if/how an attacker might induce this case - there doesn't seem to be a lot of attack surface here, but I'm filing this to investigate further. I also note that this is similar but different to bug 1387937, which was another UAF found through a static analysis tool apparently.
Group: core-security-release → javascript-core-security
Component: Internationalization → JavaScript: Internationalization API
When UVector::UVector gets failed, malloc is failed (due to OOM) in UVector::UVector. We should file a bug to ICU.
Filed against ICU. http://bugs.icu-project.org/trac/ticket/13749 I think this isn't sec-anything. Unless the last paragraph of comment 0 is still sensitive, we should open it.
Group: javascript-core-security
This has been fixed in upstream trunk. The fix will be in the next ICU release (62.1).
Priority: -- → P3
ICU has been updated to 62.1 by bug 1466471.
Assignee: nobody → andrebargull
Status: NEW → RESOLVED
Closed: 6 years ago
Depends on: 1466471
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Type: enhancement → defect
You need to log in before you can comment on or make changes to this bug.