Closed Bug 2019062 Opened 8 months ago Closed 8 months ago

Integer overflow issue in NativeLayerRootRemoteMacParent::RecvRequestReadback (testing-only)

Categories

(Core :: Graphics, defect, P3)

defect

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox148 --- wontfix
firefox149 --- wontfix
firefox150 --- fixed

People

(Reporter: mccr8, Assigned: bradwerth)

References

Details

(Keywords: ai-involved, csectype-intoverflow, sec-other, Whiteboard: [adv-main150-])

Attachments

(1 external file)

An AI audit found this issue, but the actual report is kind of bogus.

Anyways, NativeLayerRootRemoteMacParent::RecvRequestReadback has this code:

size_t readbackSize = aSize.width * aSize.height * gfx::BytesPerPixel(readbackFormat);

aSize is IntSize, and there's no validation of it, so I think width and height are int32. They could be negative or overflow which I could believe can cause problems later.

However, this isn't actually a security issue because this method fails if !xpc::IsInAutomation() so an attacker can't get at this code.

I will build a fix.

Assignee: nobody → bwerth
Severity: -- → S3
Priority: -- → P3
Attached file (secure) —

Comment on attachment 9547677 [details]
(secure)

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: Seemingly not possible. The function has an early exit for non-automation calls. Otherwise, the intent of the size validation is clear and an oversized buffer could be created.
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: No
  • Which branches (beta, release, and/or ESR) are affected by this flaw, and do the release status flags reflect this affected/unaffected state correctly?: all
  • If not all supported branches, which bug introduced the flaw?: None
  • Do you have backports for the affected branches?: No
  • If not, how different, hard to create, and risky will they be?: easy to create
  • How likely is this patch to cause regressions; how much testing does it need?: unlikely to cause regression; would require a wildly high resolution that won't occur in the wild.
  • Is the patch ready to land after security approval is given?: Yes
  • Is Android affected?: No
Attachment #9547677 - Flags: sec-approval?

This is sec-other so you don't need sec-approval to land it.

Pushed by bwerth@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/4a51574dd784 https://hg.mozilla.org/integration/autoland/rev/ac80645d490f Make NativeLayerRootRemoteMacParent::RecvRequestReadback reject invalid sizes. r=gfx-reviewers,lsalzman
Group: gfx-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
Attachment #9547677 - Flags: sec-approval? → sec-approval+
See Also: → CVE-2026-4694
QA Whiteboard: [sec] [qa-triage-done-c151/b150]
Whiteboard: [adv-main150-]
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: