Please, see source code of the page to see how the following looks:
empty onsomething event here
empty style attribute here

This is because the check around line 1140 is not completelt accurate.

The fix could look like this:

  // the attribute list ends with a valueless attribute like "selected"
  if ($mode == 1 && $attrname != 'style' && substr($attrname, 0, 2) != 'on') {
    $attrarr[] = $attrname;
  }

I cannot think of any way to include a value for those attributes, so it doesn't look critical, but anyway...

Comments

wrwrwr’s picture

StatusFileSize
new597 bytes

Ah, yes, seems quite harmless, but a valueless style or event passes through the filter as a last attribute. I would add a skip check in this case too, just for sanity.

wrwrwr’s picture

Priority: Normal » Minor
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch failed testing.

mr.baileys’s picture

Status: Needs work » Needs review
StatusFileSize
new1.52 KB

Needed a re-roll after _filter_xss_attributes() was moved to common.inc in #470632: Move filter_xss*() into common.inc. Added a test to prevent regressions.

mr.baileys’s picture

StatusFileSize
new1.25 KB

Previous patch contained a stray underscore.

dries’s picture

Status: Needs review » Reviewed & tested by the community

This looks RTBC to me. Updating status.

aspilicious’s picture

#5: filter_attribute_end.patch queued for re-testing.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.