daniel
commited on
Commit
·
7034c1e
1
Parent(s):
356ff01
Fix README frontmatter for HF Spaces
Browse files
README.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
- **JavaScript XSS Detection** - Trained on 14,000+ patterns
|
| 8 |
-
- **PHP XSS Detection** - Trained on 9,700+ balanced patterns
|
| 9 |
-
- **Multi-vulnerability detection** - Finds multiple vulnerabilities per file
|
| 10 |
-
- **Chunking support** - Handles large files by splitting into chunks
|
| 11 |
|
| 12 |
## API Endpoints
|
| 13 |
|
|
@@ -20,28 +22,11 @@ GET /api/v1/health
|
|
| 20 |
```
|
| 21 |
POST /api/v1/scan
|
| 22 |
{
|
| 23 |
-
"code": "
|
| 24 |
-
"language": "
|
| 25 |
}
|
| 26 |
```
|
| 27 |
|
| 28 |
-
|
| 29 |
-
- `php` - PHP code
|
| 30 |
-
- `js` / `javascript` - JavaScript code
|
| 31 |
-
|
| 32 |
-
## Models
|
| 33 |
-
|
| 34 |
-
This Space uses fine-tuned CodeBERT models:
|
| 35 |
-
- PHP Model: `checkpoint-1867` (92% accuracy on test cases)
|
| 36 |
-
- JS Model: `best_model` (trained on 14k real-world patterns)
|
| 37 |
-
|
| 38 |
-
## Local Development
|
| 39 |
-
|
| 40 |
-
```bash
|
| 41 |
-
pip install -r requirements.txt
|
| 42 |
-
python -m api.main
|
| 43 |
-
```
|
| 44 |
-
|
| 45 |
-
## License
|
| 46 |
|
| 47 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: XSS JS Scanner
|
| 3 |
+
emoji: 🔒
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
|
| 10 |
+
# XSS JavaScript Scanner API
|
| 11 |
|
| 12 |
+
A FastAPI-based API for detecting XSS vulnerabilities in JavaScript code using a fine-tuned CodeBERT model.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
## API Endpoints
|
| 15 |
|
|
|
|
| 22 |
```
|
| 23 |
POST /api/v1/scan
|
| 24 |
{
|
| 25 |
+
"code": "document.innerHTML = userInput;",
|
| 26 |
+
"language": "js"
|
| 27 |
}
|
| 28 |
```
|
| 29 |
|
| 30 |
+
## Model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
Uses fine-tuned CodeBERT from `mekbus/codebert-xss-js`
|