Reputation: 4206
The second piece of code here http://anautonomouszone.com/blog/xss-cheat-sheet, claims to bypass html special chars filtering (meaning, <>) by url encoding:
Bypass filter when it strips <script> tags:
%253cscript%253ealert(document.cookie)%253c/script%253e
Obviously this is URL encoding, which make the server unaware of the original content, but I can't possibly see when does it translate back into <script>
.
The server gets it like this, and send it back. HTTP content is not encoded, so the user will get it as it is.
What am I missing? Is this true for php function htmlspecialchars
?
EDIT :
After I got quite misunderstood at the chat, I'll try to make myself clear.
This is taken from an XSS cheat sheet. And other XSSes tutorials. Meaning, it's a method for trying to bypass some methods that are against XSS.
What I'm trying to understand is simple:
<script>
in the http-respone?Notice, this is in MANY sites, so it probably doesn't refer to an one-in-million-developer-mistake, but something quite likely in a way.
Thanks a lot.
Upvotes: 1
Views: 7910
Reputation: 4416
A couple of ways:
Edit: Here is an OWASP page describing the attack. At the bottom there are two links to real vulnerabilities: https://www.owasp.org/index.php/Double_Encoding
Upvotes: 1