-
-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Unicode whitespace attacks based on further research after Tom'…
…s finding
- Loading branch information
mario
committed
Jun 3, 2014
1 parent
fe15730
commit 40586b5
Showing
2 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40586b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, which browser are these working in? They weren't active some years ago when I tested, save for Opera.
But I do remember, the HTML 4.01 specification defines four whitespace characters, and explicitly does not define other cases. So, any character can be treated as whitespace by an HTML4 conforming User-Agent.
The HTML 5 specification changes that by defining five types of "space characters", and explicitly nothing else.
40586b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can haz link to “Tom’s finding”?
40586b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cweb These surprisingly worked in Chrome - but only in case the DOM is rewritten.
@mathiasbynens Just try the characters in combination with
document.write()
orinnerHTML
(or anything comparable). Will work :)40586b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicking the link on this page does not trigger an alert for me in Chrome 38:
Has this “browser bug” (debatable) been fixed since, or is my test wrong?
40586b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it on different Chrome versions without using the white-space regex and it still repros for me (Chromium 37, Chrome 38, Chrome Canary 40). So I'd assume there's no fix yet.
The code I used for testing was:
I haven't seen any tickets on crbug for this - and agree that calling it browser bug is debatable. However, it was WebKit/Blink-only behavior, so I'd be surprised it was expected :)