Git Product home page Git Product logo

finn-no / xss-html-filter Goto Github PK

View Code? Open in Web Editor NEW
118.0 118.0 100.0 461 KB

Open Sourced HTML filtering utility for Java. Used to parse user-submitted input and sanitize it against potential cross site scripting attacks, malicious html, or simply badly formed html.

Home Page: http://finn-no.github.com/xss-html-filter

License: GNU Lesser General Public License v3.0

Java 91.25% HTML 8.75%

xss-html-filter's People

Contributors

bulvestad avatar michaelsembwever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xss-html-filter's Issues

xss with angle bracket entities

Angle bracket entities in a href attribute cause the closing quote for the attribute to be converted to an entity, leaving the tag open. Other tags containing scripts can then be added after it.

Input:
<a href='&#60;/a&#x3e;'>Link</a><a href='&#60;/a&#x3e;&#39;&#60;script&#x3e;alert(1)&#x3c;/script&#x3e;'>Link</a>

Output:
<a href="</a>&quot;>Link</a><a href="</a>'<script>alert(1)</script>&quot;>Link</a>

Issues with Inputs with Encoded Entities and HTML Attributes

Hi,

I was testing the filter against a set of XSS test inputs. It seems that your filter is still vulnerable to XSS such as with inputs that contain XSS payloads in the HTML tags. Examples are:

<a href="jAvAsCrIpT&colon;alert&lpar;1&rpar;">X</a>
<img src=xx:xx" on error="alert(1);">, where it filters the on error="alert(1);" but not the <img src=xx:xx".

I kindly suggest that the whitelist used by the filter restricts tags with these attributes and events to make it more robust against XSS. Also, due to the Integer.decode() API, the filter outputs an error with inputs that contain #09, for example:
<A HREF="h tt p://6&#09;6.000146.0x7.147/">XSS</A>

A full report can be read in our paper, "Assessment of Dynamic Open-source Cross-site Scripting Filters as Security Devices in Web Applications".

Thank you.

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.