Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Defeating Cross-Site Scripting with Content Security Policy

Defeating Cross-Site Scripting with Content Security Policy

How a new proposed HTTP response header can help increase the depth of your web application defenses.

Francois Marier

March 07, 2012
Tweet

More Decks by Francois Marier

Other Decks in Programming

Transcript

  1. $ curl --head https://www.libravatar.org/account/login/ X-Content-Security-Policy: default-src 'self' ; img-src 'self'

    data ; frame-src 'self' https://browserid.org ; script-src 'self' https://browserid.org
  2. Spec: http://www.w3.org/TR/CSP/ HOWTO: https://developer.mozilla.org/en/Security/CSP Copyright © 2012 François Marier Released

    under the terms of the Creative Commons Attribution Share Alike 3.0 Unported Licence fmarier fmarier