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

'+' in opaque URL body of data: URL is renormalized incorrectly #1

Open
mikesamuel opened this issue Jan 24, 2013 · 2 comments
Open
Assignees

Comments

@mikesamuel
Copy link
Owner

No description provided.

@goldfeder
Copy link

Autoescaping this string should trigger the bug:

<a href='data:base64;a+b'>

@ghost ghost assigned mikesamuel Jan 24, 2013
@mikesamuel
Copy link
Owner Author

The input

is normalized to

I was surprised because the HTML encoding should not affect the URL seen by the browser and am loathe to stop encoding '+' because that stops UTF-7 attacks.

According to

$ python

import base64
base64.b64encode(' Hello, World!~Goodbye, World!')
'IEhlbGxvLCBXb3JsZCF+R29vZGJ5ZSwgV29ybGQh'

so I tested the HTML document

<p>
<a href='data:;base64,IEhlbGxvLCBXb3JsZCF+R29vZGJ5ZSwgV29ybGQh'>raw plus</a>
<p>
<a href='data:;base64,IEhlbGxvLCBXb3JsZCF&#43;R29vZGJ5ZSwgV29ybGQh'>encoded plus</a>

on a recent version of each of Chrome, Safari, and Firefox. Both links link to equivalent documents in all three browsers, and the browser displays the '+' properly decoded in the URL bar. I have not tested on older browsers or on any IE.

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

No branches or pull requests

2 participants