Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Fix Brave crashing on confirm bug #4891

Merged
merged 3 commits into from
Oct 19, 2016
Merged

Fix Brave crashing on confirm bug #4891

merged 3 commits into from
Oct 19, 2016

Conversation

willy-b
Copy link
Contributor

@willy-b willy-b commented Oct 18, 2016

(Realized that this can be solved with exactly what @bridiver did for alerts in #4798, just copied for confirm dialog, so replacing previous PR I had with @bridiver's sol'n)

Test Plan:

  1. Open Brave
  2. Visit http://pentesting.x10host.com (entire page content is: <script>confirm(1)</script>, so can test with data:text/html,<script>confirm(1)</script> as well)
  3. Observe that Brave does not crash, and confirm dialog with message content "1" is displayed.

Fix:

fixes #4883

- make sure that when `message` is a  number (or other non-string type) it is coerced to a string
- same change as what @bridiver did for alerts in #4798, but for confirm dialog

fixes #4883
Also fix crashes for URLs like `data:text/html,<script>alert\(1, 1\)</script>`
and `data:text/html,<script>confirm\(1, 1\)</script>`
@@ -383,6 +384,8 @@ app.on('ready', () => {
title = ''
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be removed now

if (title == null) {
    title = ''
}

@@ -368,6 +368,7 @@ app.on('ready', () => {
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto here

@bbondy bbondy added this to the 0.12.6dev milestone Oct 18, 2016
@willy-b
Copy link
Contributor Author

willy-b commented Oct 18, 2016

@bbondy, thanks for the review, I removed the extra lines. I can rebase and open a new PR or push directly to whatever branch you think is appropriate. Thanks!

@bbondy
Copy link
Member

bbondy commented Oct 19, 2016

Perfect, I'll just do a squash merge, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HackerOne] window.confirm crashes Brave
4 participants