Closed Bug 1190036 Opened 10 years ago Closed 10 years ago

clipboardData.getFilesAndDirectories() crash

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox41 --- unaffected
firefox42 --- fixed
firefox43 --- fixed
firefox-esr38 --- unaffected

People

(Reporter: jruderman, Assigned: baku)

References

Details

(4 keywords)

Attachments

(3 files, 1 obsolete file)

Attached file testcase
Assertion failure: value, at BindingUtils.h:937
Attached file stack
Group: core-security
Assignee: nobody → amarchesini
Attached patch crash.patch (obsolete) — Splinter Review
Attachment #8650989 - Flags: review?(bugs)
Comment on attachment 8650989 [details] [diff] [review] crash.patch We need this on aurora too, right? > if (!mFiles) { >+ aRv.Throw(NS_ERROR_FAILURE); > return nullptr; > } This is wrong, I mean the returning null (and now also throwing the exception). Please file a followup bug to fix. or fix in this bug. It is ok mFiles to be null and the spec says "if no files or directories were chosen, returns a Promise resolved with an empty sequence."
Attachment #8650989 - Flags: review?(bugs) → review+
Comment on attachment 8650989 [details] [diff] [review] crash.patch Approval Request Comment [Feature/regressing bug #]: bug 1164310 [User impact if declined]: a crash. [Describe test coverage new/current, TreeHerder]: No test. [Risks and why]: The patch just adds an exception. No risks at all. [String/UUID change made/needed]: none [Security approval request comment] How easily could an exploit be constructed based on the patch? Too easy. 1 line. Test included. Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem? Yes. The test shows the error clearly. Which older supported branches are affected by this flaw? aurora. If not all supported branches, which bug introduced the flaw? bug 1164310 Do you have backports for the affected branches? 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?
Attachment #8650989 - Flags: sec-approval?
Attachment #8650989 - Flags: approval-mozilla-aurora?
> [Security approval request comment] > How easily could an exploit be constructed based on the patch? > > Too easy. 1 line. Test included. The crashes I see seem to be a null dereference. How would this be exploited? > Do comments in the patch, the check-in comment, or tests included in the > patch paint a bulls-eye on the security problem? > > Yes. The test shows the error clearly. Are you checking in the test? I don't see it in the patch.
Blocks: 1164310
Flags: needinfo?(amarchesini)
Keywords: regression
Attached patch crash.patchSplinter Review
crashtest included, and sorry for the previous comment: I meant that it's easy to reproduce the crash, not to exploit it.
Flags: needinfo?(amarchesini)
Attachment #8651427 - Flags: sec-approval?
Attachment #8651427 - Flags: approval-mozilla-aurora?
Attachment #8650989 - Attachment is obsolete: true
Attachment #8650989 - Flags: sec-approval?
Attachment #8650989 - Flags: approval-mozilla-aurora?
If this bug is guaranteed to be a null deref (as it appeared in my -very-minimal- testing) then we don't need to hide this bug or request sec-approval. If it _is_ potentially exploitable we wouldn't want to include the test until after we released the fix. I assume those asserts are just regular debug-only asserts and don't actually protect us at runtime, but if we've forced asserts() on in release let me know if that's an important part of the patch.
Flags: needinfo?(amarchesini)
Yes, you are right. It's a null deref.
Flags: needinfo?(amarchesini)
Group: core-security
Attachment #8651427 - Flags: sec-approval?
https://hg.mozilla.org/integration/mozilla-inbound/rev/f90e2d3e63660fa660b641e7c8150071d6984797 Bug 1190036 - clipboardData.getFilesAndDirectories() should throw an exception when returning null, r=smaug
Blocks: 1197164
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment on attachment 8651427 [details] [diff] [review] crash.patch The patch looks safe and has an automated test. It has been in Nightly for a few days. Let's uplift to Aurora42 as it's also a crash fix.
Attachment #8651427 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: