Closed Bug 1523362 Opened 7 years ago Closed 7 years ago

heap buffer overflow read in TabParent::RecvSetCursor

Categories

(Core :: Widget, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox-esr60 66+ fixed
firefox65 --- wontfix
firefox66 + fixed
firefox67 + fixed

People

(Reporter: Alex_Gaynor, Assigned: emilio)

References

Details

(Keywords: csectype-bounds, sec-moderate, Whiteboard: [adv-main66+][adv-esr60.6+])

Attachments

(2 files, 1 obsolete file)

I noticed this when looking at the commit for bug 1520502.

https://searchfox.org/mozilla-central/source/dom/ipc/TabParent.cpp#1655-1660

This passes aCursor.BeginReading() and size. However it's never verified that aCursor's length matches size.

This can lead to a heap-buffer-overflow read from a compromised child.

This was already pre-existing, right? But sure, should be fixable, want to give it a go? Otherwise I can write the patch.

Flags: needinfo?(agaynor)

Yes, the previous version of TabParent::RecvSetCustomCursor also had this issue, I just noticed it because of that bug.

I don't know these graphics APIs well, I'd be appreciative if someone else could take a look.

Flags: needinfo?(agaynor)

Mkay.

Assignee: nobody → emilio

I think the stride < width * bpp is the right thing to check for, since I
don't know if there's any guarantee of it of the stride being equal, but let me
know if I'm wrong.

Group: dom-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

Please nominate this for Beta approval when you get a chance. Also, does this issue pre-date the changes from bug 1520502?

Flags: needinfo?(emilio)

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

Also, does
this issue pre-date the changes from bug 1520502?

Yes it does. That just moved the code.

OK, not sure it's worth rebasing for an ESR60 uplift or not. Will defer to Emilio on that one :).

301 Alex there on whether it's worth uplifting to ESR. Will submit the beta uplift request in a sec.

Flags: needinfo?(emilio) → needinfo?(agaynor)

Comment on attachment 9039598 [details]
Bug 1523362 - Validate cursor data in TabParent::RecvSetCursor. r=tnikkel

Beta/Release Uplift Approval Request

Feature/Bug causing the regression

Not sure

User impact if declined

Compromised content process could make the parent process read out-of-bounds data.

Is this code covered by automated tests?

No

Has the fix been verified in Nightly?

No

Needs manual test from QE?

No

If yes, steps to reproduce

List of other uplifts needed

None

Risk to taking this patch

Low

Why is the change risky/not risky? (and alternatives if risky)

Just sanity-checks the data.

String changes made/needed

none

Attachment #9039598 - Flags: approval-mozilla-beta?

I think the rebase should be straight forward, so +1 on uplifting to ESR -- if it's actually a mess for some reason we can reconsider.

Flags: needinfo?(agaynor)

I think I just saw some related code land on beta yesterday. in https://bugzilla.mozilla.org/show_bug.cgi?id=1431582#c29 it looks like one of the same test is enabled already (b/gfx/wr/wrench/reftests/split/reftest.list). Will that matter for your uplift?

Flags: needinfo?(emilio)

That code is not related at all. This is not WebRender related whatsoever.

Flags: needinfo?(emilio)

Comment on attachment 9039598 [details]
Bug 1523362 - Validate cursor data in TabParent::RecvSetCursor. r=tnikkel

ESR Uplift Approval Request

If this is not a sec:{high,crit} bug, please state case for ESR consideration

I guess Alex should fill this, but it's a trivial IPC hardening patch.

User impact if declined

Compromised content process could make the parent process read out-of-bounds data.

Fix Landed on Version

67

Risk to taking this patch

Low

Why is the change risky/not risky? (and alternatives if risky)

Just sanity-checks the data.

String or UUID changes made by this patch

none

Attachment #9039598 - Flags: approval-mozilla-esr60?

Comment on attachment 9039598 [details]
Bug 1523362 - Validate cursor data in TabParent::RecvSetCursor. r=tnikkel

Fix for potential sec issue, OK for uplift.
This should land for Monday's beta 5 build.

Attachment #9039598 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify-

Comment on attachment 9039598 [details]
Bug 1523362 - Validate cursor data in TabParent::RecvSetCursor. r=tnikkel

Please create a rebased patch for ESR60 approval consideration.

Flags: needinfo?(emilio)
Attachment #9039598 - Flags: approval-mozilla-esr60?
Flags: needinfo?(emilio)
Comment on attachment 9047471 [details] [diff] [review] 0001-Validate-cursor-data-in-TabParent-RecvSetCustomCurso.patch Adds some simple sanity checking to avoid a security situation. Baked on Nightly and Beta for awhile. Approved for 60.6esr.
Attachment #9047471 - Flags: approval-mozilla-esr60+
Attached patch Fixed ESR patchSplinter Review

Validate aFormat too.

Attachment #9047471 - Attachment is obsolete: true
Flags: needinfo?(emilio)
Attachment #9047471 - Flags: approval-mozilla-esr60+
Attachment #9048571 - Flags: approval-mozilla-esr60+
Whiteboard: [adv-main66+][adv-esr60.6+]
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: