Text Generation
PEFT
Safetensors
English
code
security
vulnerability-detection
injection
code-analysis
lora
qwen2
cybersecurity
sast
cwe
conversational
Eval Results (legacy)
Instructions to use vikramdgx/injection-vulnerability-detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use vikramdgx/injection-vulnerability-detector with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-Coder-7B-Instruct") model = PeftModel.from_pretrained(base_model, "vikramdgx/injection-vulnerability-detector") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -119,6 +119,28 @@ Our **primary metric is the in-scope novel row** — performance on the 9 CWEs t
|
|
| 119 |
| CWE-1336 | Server-Side Template Injection | 100.0% | 100.0% | 100.0% | 6 |
|
| 120 |
| CWE-113 | HTTP Response Splitting | 100.0% | 100.0% | 100.0% | 4 |
|
| 121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
### Evaluation methodology
|
| 123 |
|
| 124 |
Standard group-aware splitting (by CVE ID / project) prevents the *same* code
|
|
|
|
| 119 |
| CWE-1336 | Server-Side Template Injection | 100.0% | 100.0% | 100.0% | 6 |
|
| 120 |
| CWE-113 | HTTP Response Splitting | 100.0% | 100.0% | 100.0% | 4 |
|
| 121 |
|
| 122 |
+
### High-confidence mode (zero false positives)
|
| 123 |
+
|
| 124 |
+
The `tainted_flow` field doubles as a confidence signal. Accepting a `VULNERABLE`
|
| 125 |
+
verdict **only when the model names a concrete source and sink** filters out its
|
| 126 |
+
weakest calls:
|
| 127 |
+
|
| 128 |
+
| Mode | Precision | Recall | F1 |
|
| 129 |
+
|---|---|---|---|
|
| 130 |
+
| Standard (all VULNERABLE verdicts) | 81.7% | 58.3% | 68.0% |
|
| 131 |
+
| High-confidence (concrete `tainted_flow` required) | **100.0%** | 22.1% | 36.2% |
|
| 132 |
+
|
| 133 |
+
On the in-scope novel test set this yielded **44 true positives and 0 false
|
| 134 |
+
positives** (n=496). Use high-confidence mode where alert fatigue matters more than
|
| 135 |
+
coverage (CI gating, auto-filing issues); use standard mode for triage sweeps where
|
| 136 |
+
a human reviews each finding.
|
| 137 |
+
|
| 138 |
+
```python
|
| 139 |
+
r = json.loads(response)
|
| 140 |
+
flow = r.get("tainted_flow") or {}
|
| 141 |
+
high_confidence = r.get("verdict") == "VULNERABLE" and flow.get("source") and flow.get("sink")
|
| 142 |
+
```
|
| 143 |
+
|
| 144 |
### Evaluation methodology
|
| 145 |
|
| 146 |
Standard group-aware splitting (by CVE ID / project) prevents the *same* code
|