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

Security Considerations Oversight #2174

Closed
brocef opened this issue Feb 8, 2017 · 3 comments · Fixed by #2364
Closed

Security Considerations Oversight #2174

brocef opened this issue Feb 8, 2017 · 3 comments · Fixed by #2364
Labels

Comments

@brocef
Copy link

brocef commented Feb 8, 2017

Not a bug report, per se, but still should be noted. On the Security Considerations page, after describing the XSS remediation that Jinja2 provides, it describes the one caveat that unquoted html attributes are still vulnerable. It follows with a "correct" example:
<a href="{{ href }}">the text</a>

However that example is also vulnerable to XSS. An attacker could still set href to javascript:alert(1) to inject javascript into the tag (although it would require a user to click the link).

Perhaps the example should use a different quoted attribute as the example, like a default value for an input field or something of the like.

@ThiefMaster
Copy link
Member

input value seems like a good idea

@untitaker
Copy link
Contributor

untitaker commented Feb 8, 2017 via email

@davidism
Copy link
Member

davidism commented Jun 6, 2017

Content-Security-Policy can prevent executing javascript: URIs. I'll mention that in the docs. https://developer.chrome.com/extensions/contentSecurityPolicy#JSExecution

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants