HTML spec change: escaping < and > in attributes

37 points by jmillikin


kornel

mXSS is a terrible flaw in the syntax. The interaction between HTML, XML, and error recovery is mind-bogglingly complex, in more evil ways than it seems. Correctly implemented parsing of HTML can result in a DOM tree that can’t be expressed in valid HTML syntax, and to serialize it you’d have to reason backwards into what invalid states you’d need to introduce earlier to land at this. It’s almost like reversing a hash.

It’s a shame the problem hasn’t been caught when HTML5 added SVG support.