10000 fix: security doc now provides solid url check by polict · Pull Request #16775 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: security doc now provides solid url check #16775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

polict
Copy link
Contributor
@polict polict commented Feb 6, 2019

Description of Change

The security doc now provides a solid check, as in point 11 and 12.

Release Notes

Notes: fixes issue #16774

@polict polict requested a review from a team February 6, 2019 10:11
@welcome
Copy link
welcome bot commented Feb 6, 2019

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@polict polict changed the title fixes #16774: fix security doc url check fix: url check now provides solid check Feb 6, 2019
@polict polict changed the title fix: url check now provides solid check fix: security doc now provides solid url check Feb 6, 2019
@@ -278,7 +278,8 @@ session
callback(true)
}

if (!url.startsWith('https://my-website.com')) {
// Verify URL
if (!url.startsWith('https://my-website.com/')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

how does that extra / benefit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I said in #16774, the current example (if followed by the reader) can be bypassed with an URL which starts with the required string, but may be a subdomain (or part of the domain) like https://my-website.com.attacker.com, which passes the check.
Also, this follows the example provided in point 11 (https://github.com/electron/electron/blob/master/docs/tutorial/security.md#how-9). Another option would be to parse the URL and strictly check the origin like in point 12 (https://github.com/electron/electron/blob/master/docs/tutorial/security.md#how-10).

Copy link
Member
@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

Thanks for the solid catch @polict

@MarshallOfSound MarshallOfSound merged commit c764597 into electron:master Feb 6, 2019
@release-clerk
Copy link
release-clerk bot commented Feb 6, 2019

Release Notes Persisted

fixes issue #16774

@welcome
Copy link
welcome bot commented Feb 6, 2019

Congrats on merging your first pull request! 🎉🎉🎉

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

Successfully merging this pull request may close these issues.

3 participants
0