OWASP Top Ten , - . OWASP ESAPI XSS. ESAPI , , Java,.NET, PHP, Classic ASP, Cold Fusion, Python Haskell. , :
encodeForHTML
encodeForHTMLAttribute
encodeForJavaScript
encodeForCSS
encodeForURL
, , :
boolean isValidURL = ESAPI.validator().isValidInput("URLContext", userURL, "URL", 255, false);
Some organizations using ESAPI include American Express, Apache Foundation, Booz Allen Hamilton, Aspect Security, Foundstone (McAfee), Hartford, Infinite Campus, Lockheed Martin, MITER, US Navy - SPAWAR, World Bank, SANS Institute.
I also recommend giving them an XSS Prevention Cheat Sheet read that describes best practices for building your protection against XSS (in essence, it comes down to the fact that you MUST use the escape syntax for the part of the HTML document into which you are placing untrusted data).
source
share