Closed Bug 1910306 (CVE-2024-7526) Opened 1 year ago Closed 1 year ago

WebGL in Firefox does not pre-initialize out-variable that lead to possible vulnerability/leak (mac/linux/android)

Categories

(Core :: Graphics: CanvasWebGL, defect, P1)

Firefox 127
defect

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox-esr115 129+ verified
firefox-esr128 129+ verified
firefox128 --- wontfix
firefox129 + verified
firefox130 + verified

People

(Reporter: s48gs.w, Assigned: jgilbert)

References

Details

(Keywords: csectype-uninitialized, reporter-external, sec-high, Whiteboard: [adv-ESR115.14+][adv-ESR128.1+][adv-main129+])

Attachments

(6 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

This is only AMD GPU OpenGL Firefox in Linux bug.
AMD GPU - required.
Linux - required.

I tested bug on Vega8 integrated GPU.
I tested bug on Firefox 127, 129, 130 - works same.

Why this is Firefox bug - because on same PC in Chrome this bug not happening - because Chrome pre-initialize all "out" variables.

Bug:
0. Linux - Firefox - AMD GPU

  1. visit https://www.shadertoy.com/view/XcjyWz
  2. if you see noise on Shadertoy canvas - bug is working.
  3. Now open any active-redraw anything, even youtube video in other tab/browser - and look on pattern change.

That fact that "color" or/and pattern of noise change/depends from outside activity - is bug.
And in case of integrated GPU - where GPU VRAM allocated in RAM - it may be possible to "do more" with this bug.

Actual results:

Watch this video of this bug working:
https://youtu.be/sZFNDh3JzfI

Screenshots from this video in attachment.

Expected results:

No noise on screen, color not leaking.

Group: firefox-core-security
OS: Unspecified → Linux
Hardware: Unspecified → Desktop
Group: firefox-core-security → core-security
Component: Untriaged → Graphics: CanvasWebGL
Product: Firefox → Core
Group: core-security → gfx-core-security
Assignee: nobody → jgilbert
Severity: -- → S2
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P1

[Tracking Requested - why for this release]: sec-high that we want to fix before 129 goes to Release.

[Tracking Requested - why for this release]: sec-high that we want to fix before 129 goes to Release.

I don't think we want to try to push this into 128, but we should make sure it gets in 129, and goes back to ESRs.

Marking sec-high per comment 3. That sounds like a reasonable rating to me.

Following the link in the commit from comment 1, it looks like a fix was landed in March 2023. Kind of odd that the chromium issue is still closed.

OS: Linux → All
Hardware: Desktop → All

It looks like this should apply cleanly to all backports: beta129, esr128, and esr115! :D

:jgilbert/:dveditz we are in RC week for Fx129
Fx129 is already in release and we have already built ESR128 and ESR115 release candidates.
Wondering if this should wait for Fx130 and it's corresponding ESR128/ESR115 releases?

Flags: needinfo?(jgilbert)
Flags: needinfo?(dveditz)

Comment on attachment 9416686 [details]
Bug 1910306 - [angle] Cherry-pick zero-initialization of unwritten GLSL out params.

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: Moderate difficulty to develop an exploit to gather eavesdropped gpu data. Weaponizing sounds hard but not impossible.
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: Yes
  • 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?: Yes
  • If not, how different, hard to create, and risky will they be?:
  • How likely is this patch to cause regressions; how much testing does it need?: Unlikely, since this is what ANGLE patched upstream, but there is risk that there was a follow-up to fix a regression there that I didn't notice.
    CI testing will assure reliability.
    Manual testing should be done to confirm that the patch works though.
  • Is the patch ready to land after security approval is given?: Yes
  • Is Android affected?: Yes
Flags: needinfo?(jgilbert)
Attachment #9416686 - Flags: sec-approval?

Comment on attachment 9416686 [details]
Bug 1910306 - [angle] Cherry-pick zero-initialization of unwritten GLSL out params.

sec-approval+ = dveditz for landing in 130/mozilla-central.

It can't really hurt too much to land the patch now since the ANGLE fix has been public for over a year. On the other hand, if chrome didn't announce the fix (their bug is still private) people might have missed the ANGLE version and we're giving them another chance to discover it now. I think that's OK: this appears to be mainly a memory disclosure issue and not memory corruption.

This isn't a "stop-ship/chemspill" kind of bug so I think we have to live with having missed RC. I'd love to get it into any point release as a ride-along, though. The main complication is we need to fix all the branches and we don't always do point releases for ESR.

Flags: needinfo?(dveditz)
Attachment #9416686 - Flags: sec-approval? → sec-approval+

(In reply to Andrew McCreight [:mccr8] from comment #5)

Following the link in the commit from comment 1, it looks like a fix was landed in March 2023. Kind of odd that the chromium issue is still closed.

I can easily imagine that one or more other bugs might cause Chrome to update the ANGLE changeset they pull (they do that all the time), and then Chrome picks up all the fixes in between without consciously tracking them. But this diff is explicitly tagged with a chromium bug number and not an angle bug which makes very unlikely they just "accidentally" fixed it without their tree and sheriff bots noticing. Curious.

[Tracking Requested - why for this release]:

It would be safer to fix this as a ride-along in a 129-and-equivalent-ESRs point release. But if we don't do an ESR point release (and we usually don't) then it's probably safe enough to wait until 130. But looking at comment 4 maybe Kelsey knows something about this patch that we don't.

restoring Kelsey's needinfo for Donal's question in comment 7. I suspect it was cleared unintentionally when adding the sec-approval request (happens to me all the time)

Flags: needinfo?(jgilbert)

We could respin 129.0 RC, 128.1esr, and 115.14esr to include this before next week's go-live.
To include this the patch would need to land today and get uplift requests for release, esr115, and esr128.
Then we are all set to respin the RC builds tomorrow.

@ahale says:

confirmed that your fix works on the Framework 13 AMD laptop running Linux Mint 22, I built it with and without your patch and the shadertoy display is black with your patch, uninitialized data noise without your patch

Flags: needinfo?(jgilbert)
Attachment #9417059 - Flags: approval-mozilla-beta?
Pushed by jgilbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/94848c2cb22e [angle] Cherry-pick zero-initialization of unwritten GLSL out params. r=gfx-reviewers,nical

beta Uplift Approval Request

  • User impact if declined: sec-high
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Testing steps in bug description
  • Risk associated with taking this patch: Low
  • Explanation of risk level: Patch for this purpose from upstream, vetted and baked there.
  • String changes made/needed: none
  • Is Android affected?: yes
Flags: qe-verify+
Attachment #9417065 - Flags: approval-mozilla-esr128?

esr128 Uplift Approval Request

  • User impact if declined: sec-high
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Test steps in bug description
  • Risk associated with taking this patch: low
  • Explanation of risk level: Targetting cherry-picked patch, vetted and baked upstream
  • String changes made/needed: none
  • Is Android affected?: yes

@ahale says:

confirmed that your fix works on the Framework 13 AMD laptop running Linux Mint 22, I built it with and without your patch and the shadertoy display is black with your patch, uninitialized data noise without your patch

Attachment #9417059 - Flags: approval-mozilla-release?
Attachment #9417067 - Flags: approval-mozilla-esr115?

esr115 Uplift Approval Request

  • User impact if declined: sec-high
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Testing steps in bug description
  • Risk associated with taking this patch: low
  • Explanation of risk level: Targetted patch, vetted and baked upstream
  • String changes made/needed: none
  • Is Android affected?: yes

Windows is unaffected, but Mac, Linux, and Android are affected.

Summary: WebGL in Firefox does not pre-initialize out-variable that lead to possible vulnerability/leak (working example in) → WebGL in Firefox does not pre-initialize out-variable that lead to possible vulnerability/leak (mac/linux/android)
Attachment #9417059 - Flags: approval-mozilla-beta?
Group: gfx-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
Whiteboard: [adv-ESR115.14+]
Whiteboard: [adv-ESR115.14+] → [adv-ESR115.14+][adv-ESR128.1+]
QA Whiteboard: [qa-triaged]

The patch landed in nightly and beta is affected.
:jgilbert, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox129 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(jgilbert)

This already has the required uplift requests

Flags: needinfo?(jgilbert)
Attachment #9417059 - Flags: approval-mozilla-release? → approval-mozilla-release+

Reproduced the issue described in comment 0 using a machine with AMD Radeon HD5450 (Cedar) and AMD® Fx(tm)-8320 eight-core processor on Firefox 129.0 (Ubuntu 22.04).
Verified that using latest Nightly build 130.0a1 from treeherder containing the fix there is no noise in the demo website at all, not even if I open a few videos in Nightly or other browser.

Attachment #9417065 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+
Attachment #9417067 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Whiteboard: [adv-ESR115.14+][adv-ESR128.1+] → [adv-ESR115.14+][adv-ESR128.1+][adv-main129+]
Attached file advisory.txt

Also verified using latest builds of Firefox 115.14.0esr, Firefox 128.1.0esr and Firefox 129.0 with the fix on the same machine used to reproduce this and this is no longer an issue.

Alias: CVE-2024-7526
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: