Skip to main content

A Shield to protect against xss

Project description

## Badges

[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)

# XSS Shield

The primary objective of xss shield is to find the possible xss attack and block the request or return None. As xss is one the most common bug in web applications security researchers a finding ways to prevent it and hackers are creating more advanced payloads. most modern frameworks prevents xss by escaping special characters but still xss can be found. as react and djangos jinja2 tamplate engine does escapes the special characters but injecting user inputs in href attr {{ }} can be possible to exploit xss.

## Usages

You can use the shield as a middleware by adding it into the settings.py middleware list

MIDDLEWARE = [

‘shield.middleware.XssShieldMiddleware’,

]

Or you can use it as filter to where you want to senitize

{% load shield_tag %}

it has two filters one to senitize the value for not injecting as javascript: or data: URI variables

{{ data|protect }}

The other process bruteforcess through a list of event handlers which is possible to lead into xss

{{ data|bruter }} Thats much simple it is :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-xss-shield-1.0.dev0.tar.gz (3.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page