Some modern tools to mitigate XSS/make XSS virtually impossible: - Content-Security-Policy https://developer.mozilla.org/en-US/docs/Web/Security/CSP/In... - The sandbox attribute on iframes: https://developer.mozilla.org/en/docs/Web/HTML/Element/ifram... XSS is one of the hardest things to keep under control at scale.
One of the projects I'm working on aims to make it easier to integrate CSP headers into web applicatons. https://github.com/paragonie/csp-builder I'm working this week to integrate it into another project we're developing. (It's MIT licensed, so have fun with it.)
What I learned from suffering my first and last XSS attack
11–20 of 43 posts
Re: What I learned from suffering my first and last XSS attack
#12Earlier quoted context omitted.
One of the projects I'm working on aims to make it easier to integrate CSP headers into web applicatons. https://github.com/paragonie/csp-builder I'm working this week to integrate it into another project we're developing. (It's MIT licensed, so have fun with it.)
Hi CiPHPerCoder. Can I PM you?
security@ my company's domain name
I'm pretty sure HN doesn't have PMs.Re: What I learned from suffering my first and last XSS attack
#13Earlier quoted context omitted.
Yep. XSS isn’t at all hard to prevent if you’re using tools that are safe by default. Unfortunately, popular ones like jQuery aren’t. (This, more than any other, is a reason to prefer the DOM API.)
I'm not sure the DOM API is safer. innerHtml vs html()
APIs like jQuery are worse because you end up treating strings as HTML without even realizing it. Example from the article:
$("#tail-here").prepend(newlines);
There's no hint on that line that the `newlines` variable is interpreted as HTML instead of text.Re: What I learned from suffering my first and last XSS attack
#14Re: What I learned from suffering my first and last XSS attack
#15Re: What I learned from suffering my first and last XSS attack
#16Re: What I learned from suffering my first and last XSS attack
#17The HTML framework I created for personal projects has a special string type that cannot be output (nor even compiled) without specifically selecting which format you want the string encoded as (eg HTML, URL, plain text, etc). While this does produce some arguably uglier code and creates a little additional development overhead (ie code fails to compile by default), it has caught numerous instances where I would have…
Re: What I learned from suffering my first and last XSS attack
#18What is that tool you used for realtime traffic monitoring?