Closed
Bug 526334
Opened 15 years ago
Closed 14 years ago
Disallowed HTML is stripped instead of escaped
Categories
(addons.mozilla.org Graveyard :: Public Pages, defect, P4)
addons.mozilla.org Graveyard
Public Pages
Tracking
(Not tracked)
RESOLVED
FIXED
4.x (triaged)
People
(Reporter: clouserw, Assigned: clouserw)
Details
(Whiteboard: [z])
Attachments
(3 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details |
From bug 343573 comment 39:
The spec (in that bug) says "Any tags included that are not allowed should be displayed as entities rather than stripped out."
This is just adding $this->config->set('Core.EscapeInvalidTags', true) however, we're passing the strings to our view sanitized, and then unsanitizing them when we need them in that form. Our unsanitize() function uses preg_replace() which doesn't care how many replacements it does, meaning this is a regular occurance: &lt; -> < -> > . This effectively ruins our sanitization with mixed levels of escaping. The current code is stripping out the entities which is working fine.
We could fix this by passing the strings to the view individually with set() but that's pretty dirty. I don't feel this is a high enough priority to block 5.3, so I'm splitting it into it's own lower priority bug.
Assignee | ||
Comment 1•15 years ago
|
||
Assignee | ||
Comment 2•15 years ago
|
||
This can be committed anytime
Assignee: nobody → clouserw
Target Milestone: --- → 5.5
Assignee | ||
Updated•15 years ago
|
Priority: -- → P4
Assignee | ||
Comment 3•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 4•15 years ago
|
||
Wil: mind relaying a quick testcase? Thanks!
Assignee | ||
Comment 5•15 years ago
|
||
Sure put this in a field that allows html: <script>alert('blah')</script>
On the live site it will disappear, on preview it will be shown on the page (escaped).
Comment 6•15 years ago
|
||
Comment 7•15 years ago
|
||
Comment 8•15 years ago
|
||
Verified FIXED on https://preview.addons.mozilla.org/en-US/developers/addon/edit/9331/descriptions; thanks, Wil!
Status: RESOLVED → VERIFIED
Assignee | ||
Comment 9•15 years ago
|
||
Had to back this patch out because it was making XSS possible. Kicking out of 5.5. too.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Target Milestone: 5.5 → ---
Assignee | ||
Updated•15 years ago
|
Target Milestone: --- → 4.x (triaged)
Assignee | ||
Updated•15 years ago
|
Whiteboard: [z]
Assignee | ||
Comment 10•14 years ago
|
||
boom!
Status: REOPENED → RESOLVED
Closed: 15 years ago → 14 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•