coercive / xss
Coercive Security Router
Installs: 1 273
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7
README
A simple detection of XSS attack in url. like '<' '>' and quotes...
Get
composer require coercive/xss
Load
use Coercive\Security\Xss; # Test URL $url = "https://mywebsite.com/?var='%22><script>alert();</script>"; # Load with construct param $xss = new XssUrl($url); # Or use setUrl on an alredy loaded instance $xss = new XssUrl; $xss->setUrl($url); # Detect if($xss->isXss()) { die; }
New detection optimisation
# Test encoded url with script => alert('XSS') $url = "javascript:alert('XSS')"; # Load with construct param $xss = new XssUrl($url); # Show example echo '<a href="'.$url.'">BEFORE<a>'; echo '<br />'; echo '<a href="'.$xss->getFiltered().'">AFTER<a>';