Closed Bug 1791598 (CVE-2022-40674) Opened 2 years ago Closed 2 years ago

Evaluate expat CVE-2022-40674 fix

Categories

(Core :: XML, defect)

defect

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox-esr102 - wontfix
firefox105 - wontfix
firefox106 - wontfix
firefox107 + fixed

People

(Reporter: RyanVM, Assigned: peterv)

References

Details

(Keywords: sec-moderate, Whiteboard: [adv-main107+])

Attachments

(2 files)

The new expat 2.4.9 release shipped today included a CVE fix:

#629 #640 CVE-2022-40674 -- Heap use-after-free vulnerability in function doContent. Expected impact is denial of service or potentially arbitrary code execution.

https://github.com/libexpat/libexpat/pull/629/commits/4a32da87e931ba54393d465bb77c40b5c33d343b

While our RLBox sandboxing likely mitigates the severity of this issue, we still might want to consider cherry-picking the fix to our import for safety's sake.

Flags: needinfo?(peterv)
Assignee: nobody → peterv
Status: NEW → ASSIGNED

[Tracking Requested - why for this release]: From a background conversation with Tom -- RLBoxing makes this less severe, but we should get this fixed and uplifted

Flags: needinfo?(tom)

The 2.4.9-based patch linked in comment 0 doesn't apply cleanly because of some object restructuring, though it totally applies functionally. Debian is maintaining a 2.2.10-based fork so their version of the patch might be easier to use.

Attachment #9297440 - Attachment description: WIP: Bug 1791598 - Ensure raw tagnames are safe exiting internalEntityParser. r?mccr8! → Bug 1791598 - Ensure raw tagnames are safe exiting internalEntityParser. r?mccr8!
Pushed by pvanderbeken@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8ff03ef1553f Ensure raw tagnames are safe exiting internalEntityParser. r=mccr8

Peter, are you going to request an uplift to release and esr branches?

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch

I spent some time writing a testcase for this (which was a bit tricky, have to block the parser at the right time and pause sending data to force a boundary in the buffer in the right spot). It turns out that we ran into this issue while fixing some crashes and intermittent failures after landing RLBox, and bholley landed a similar fix (bug 1746996). I had vaguely assumed that the failure was specific to our copy of Expat, but apparently not :-/. So we don't need to port this to branches that already have the fix for bug 1746996 (which landed in 96).

Flags: needinfo?(peterv)

Hi Ryan,

I might have a silly question: Why not backporting this to ESR102? Does it mean that the CVE-2022-40674 was already fixed by https://bugzilla.mozilla.org/show_bug.cgi?id=1746996 as mentioned by :peterv? So, in this case, I would expect no change needed also in FF107 or that the fix lands in both FF107 and ESR102.5, right?

Sorry for the confusion, but I would like to understand the severity of this fix and if it is okay to still use ESR102 or wait until ESR115 to use it again.

Flags: needinfo?(ryanvm)

That was my understanding of comment 10, yes. We effectively fixed this bug already in 96.

Flags: needinfo?(ryanvm)

That said, Peter, can you confirm that comment 10 applies in the non-RLBox scenario (as I understand it, some distros don't have it enabled in their builds)?

Flags: needinfo?(peterv)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #13)

That said, Peter, can you confirm that comment 10 applies in the non-RLBox scenario (as I understand it, some distros don't have it enabled in their builds)?

Yes.

Flags: needinfo?(peterv)
Alias: CVE-2022-40674
Whiteboard: [adv-main107+]
Attached file advisory.txt
Alias: CVE-2022-40674 → CVE-2022-45414

bad script

Alias: CVE-2022-45414 → CVE-2022-40674
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: