Git Product home page Git Product logo

xssfoe's Introduction

XSSFoe

"A Java based XSS attack prevention library inspired by OWASP guidance"

What is XSS

OWASP says "Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted web sites."

WIKIPEDIA says "Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications."

XSSFOE says "Cross-Site Scripting (XSS) is an attack style done by bad and mean internet user toward our good and cool website."

Why protect your website from XSS ?

Well, websites usually accepting information from many sources. They accept user/password when a user logging in. They accept user particulars when they're registering. While Good and honest user will provide good data. But thiefs, robbers, bad bad guys tend to submit wrong information. Thanks to the advancement of technologies this days, browser is getting smart and smarter. This blessing to web browser is also become it's curse. When users send information from their browser to your website, this information commonly shown back to the user, and while displaying this information, the browser executes information for display or processing purpose, regardles if the information is good or bad. This makes the browser become a threat to your visitor's privacy, their sensitive data, their computer, their bank account, your website and their (and your) live.

With a little improvised effort, Bad Guys can steal other user's information (like password), etc. Yes... that bad.

What does this library do ?

This library provide a string filter mechanism, to strip/remove or modify an input string containing possible XSS attack vector and return a "safe" form of it. It utilizes lots of regular expression patterns to scan given string looking for potential XSS form.

Or, simply try to detect what ever bad information get sent to the server, try remove them before it get accepted further by the server for safe keeping or display.

Wait !! Before you guys says it !!

I know, i know. The best XSS prevention is to do "Positive XSS Prevention Model" as OWASP says it. Basicaly, it strips all XSS threat prior out-put them (usually into an HTML). Well, this is a simple library, it doesn't have a HTML parser (YET). So, it filter based on the input as it coming to the server in HTTP request. So far, it serve me well.

Still, I'm more than willing to enhance the library for the good of every body. You know html parsing ? Contact me !! Immediately !!

This library also do not protect XSS as it were outputted in non HTML documents, if the attack comes from the CSS style then why on earth you let the user input to become an output in your CSS style ?

Well, I say, I filter them out as they comes in. So it safe for outputing everything =).

How to user XSSFoe ?

You can use the servlet filter in your web.xml, add the following snippet into your web.xml. Make sure you included xssfoe's jar file into your web app's lib.

<filter>
   <filter-name>XSSFoe</filter-name>
   <filter-class>org.xssfoe.xss.XSSFilter</filter-class>
</filter>

<filter-mapping>
   <filter-name>XSSFoe</filter-name>
   <url-pattern>/*</url-pattern>
</filter-mapping>

Want to contribute ?

YES, we need contributor !! For ye who are willing ! in the name of open-source. Join us in our holy war against XSS attacks ! We need your feedback, your input, and your code !! We also accept money, LOL, who doesn't ?! =)

xssfoe's People

Contributors

newm4n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.