insane in the iframe -- the case for client-side html sanitization

Post on 06-Jul-2015

2.379 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Server-side HTML sanitization is a familiar web application building block, yet despite years of offensive security research, defensive “sanitizer science” is still a kind of voodoo magic. This talk will make the case that as server-side HTML sanitizers lack the ability to effectively simulate every potential user agent, the client itself is the only party empowered to perform accurate sanitization. We will examine the DOM API primitives required to perform such client-side sanitization and review results and learning from a prototype implementation.

TRANSCRIPT

David RossPrincipal Software Security EngineerTrustworthy Computing SecurityMicrosoft

difficult

• No independent parsing / context handling

document.implementation.createHTMLDocument

3. Remove elements / attributes / etc. not explicitly allowed*

* Old (less-performant) approach:Build yet another DOM by copying safe elements / attributes / etc. to a new DOM during tree walk

[Demo] [Benchmark]

Options precedence / inheritance rules: (Options specified on target element) > (options specified on sanitize() call) > (default options)

I just presented on HTML sanitization at OWASP AppSec EU 2013. AMA! (self.AMA)

1 Submitted 1 second ago by randomdross

0 comments share

top related