Site Security Policy voorstel tegen XSS & CSRF
Een werknemer van Mozilla heeft een nieuwe voorstel uit gebracht dat het gevaar van Cross Site Scripting (XSS) en Cross Site Request Forgery (CSRF) moet beperken. Het voorstel beschrijft namelijk manieren om op te geven welke hosts / domeinen bijv. Javascript mogen aanleveren of juist een bepaald request mogen uitvoeren. Mocht er een situatie voorkomen waarbij een van deze regels doorbroken zou worden (bijv: een niet toegestane host probeert request uit te voeren), dan kan de site ook een URL opgeven waarnaar een rapport gestuurd moet worden.
Site Security Policy provides a way to greatly reduce or altogether eliminate a website's attack surface for Cross-Site Scripting. With proper Site Security Policy in place, a successful XSS attack will require the attacker to have control over the contents of white-listed script source files. No longer will XSS attacks which rely on echoing script into page contents be effective. Further, if a site knows it never want to have JavaScript executing in its pages, it can simply globally disable JavaScript and not have to worry about script injection attacks against its users with supporting browsers.
Site Security Policy also provides a simple way for a website to prevent Cross-Site Request Forgery against its sensitive resources. A comprehensive CSRF protection mechanism, such as form token checking, can be complicated to implement and difficult to integrate into an existing web application. Such a mechanism may even be subject to its own security bugs. Even a properly implemented CSRF-protection-token system will not stand up in an environment with XSS bugs. Web sites facing these challenges can utilize Site Security Policy to harden themselves against attack and achieve a higher level of confidence in the security of their systems with an added layer of security. Websites will be able to fully control who can request resources from outside the site and what remote locations should be reachable by content from within the site.
Het voorstel is compleet met voorbeelden van syntax en zelfs een Firefox Addon waarin het voorgestelde reeds is geimplementeerd. Wat denk jij, zou een dergelijke beveiliging vanuit de browser helpen, of moet de focus toch meer bij de ontwikkelaars blijven liggen?
Volg Scriptorama via RSS!