
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
A Python package for detecting Cross-Site Scripting (XSS) attacks using machine learning.
pip install xss-detector
Check a specific string for XSS:
xss-detector check "<script>alert(1)</script>"
Check a file for XSS:
xss-detector file suspicious.html
Check a URL:
xss-detector url "https://example.com/?param=value"
Start the API server:
xss-detector server --port 5000
from xss_detector import XSSDetector
# Initialize the detector
detector = XSSDetector()
# Check a single string
result = detector.detect('<img src="x" onerror="alert(1)">')
print(f"XSS detected: {result['is_xss']}, Confidence: {result['confidence']}")
# Analyze a full HTTP request
analysis = detector.analyze_request(
url_params={'search': 'something<script>alert(1)</script>'},
headers={'User-Agent': 'Mozilla/5.0'},
cookies={'session': 'abc123'}
)
print(f"Request contains XSS: {analysis['xss_detected']}")
Start the server:
xss-detector server
Then make requests:
# Check a single string
curl -X POST http://localhost:5000/check \
-H "Content-Type: application/json" \
-d '{"text": "<script>alert(1)</script>"}'
# Analyze a full request
curl -X POST http://localhost:5000/proxy \
-H "Content-Type: application/json" \
-d '{"param": "<img src=x onerror=alert(1)>"}'
The package automatically downloads a dataset and trains a model on first use. To manually train a new model:
xss-detector train
MIT
FAQs
A package for detecting XSS attacks using machine learning
We found that xss-detector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.