mozSanitizingHTMLSerializer allows invalid attributes by converting to ASCII

RESOLVED FIXED in mozilla13

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: ehoogeveen, Assigned: ehoogeveen)

Tracking

Trunk
mozilla13
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 597271 [details] [diff] [review]
Switch to lossless (UTF-8) conversion to avoid false positives

While looking at a change in bug 492931, bz noticed that mozSanitizingHTMLSerializer::IsAllowedAttribute() is returning false positives by lossily converting the UTF-16 attribute name to ASCII. Simply switching from the lossy conversion to a lossless UTF-16 to UTF-8 conversion should fix this, the extra non-ASCII characters making the attr_bag->Has() call fail.

This patch applies on top of my patch in bug 492931, but it could easily be separated out.
Attachment #597271 - Flags: review?(bzbarsky)
(Assignee)

Updated

6 years ago
Hardware: x86_64 → All
Comment on attachment 597271 [details] [diff] [review]
Switch to lossless (UTF-8) conversion to avoid false positives

r=me.  Good solution!
Attachment #597271 - Flags: review?(bzbarsky) → review+

Updated

6 years ago
Assignee: nobody → emanuel.hoogeveen
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: checkin-needed
Whiteboard: [autoland-try]

Updated

6 years ago
Whiteboard: [autoland-try] → [autoland-in-queue]

Comment 2

6 years ago
(In reply to Emanuel Hoogeveen from comment #0)
> This patch applies on top of my patch in bug 492931, but it could easily be
> separated out.

Ah
Keywords: checkin-needed
Whiteboard: [autoland-in-queue]

Comment 3

6 years ago
Autoland Patchset:
	Patches: 597271
	Branch: mozilla-central => try
Error applying patch 597271 to mozilla-central.
patching file content/base/src/mozSanitizingSerializer.cpp
Hunk #1 FAILED at 549
1 out of 1 hunks FAILED -- saving rejects to file content/base/src/mozSanitizingSerializer.cpp.rej
abort: patch failed to apply

Could not apply and push patchset:
(Assignee)

Comment 4

6 years ago
Created attachment 598483 [details] [diff] [review]
Switch to lossless (UTF-8) conversion to avoid false positives

Sorry Ed, here's the patch split off from bug 492931. Carrying forward review+ as the refactoring itself is trivial and bz already looked at it once. Boris, let me know if that's not okay.
Attachment #597271 - Attachment is obsolete: true
Attachment #598483 - Flags: review+
Attachment #598483 - Flags: checkin?(bmo)

Comment 5

6 years ago
Comment on attachment 598483 [details] [diff] [review]
Switch to lossless (UTF-8) conversion to avoid false positives

https://tbpl.mozilla.org/?tree=Try&rev=9abfa93dc3d3

https://hg.mozilla.org/integration/mozilla-inbound/rev/9a6fcf299f29

:-)
Attachment #598483 - Flags: checkin?(bmo) → checkin+

Updated

6 years ago
Target Milestone: --- → mozilla13

Comment 6

6 years ago
https://hg.mozilla.org/mozilla-central/rev/9a6fcf299f29
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Comment 7

6 years ago
\o/
Target Milestone: mozilla13 → ---
(Assignee)

Updated

6 years ago
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.