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
|
@@ -136,6 +136,8 @@ coverage (CI gating, auto-filing issues); use standard mode for triage sweeps wh
|
|
| 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")
|
|
@@ -238,7 +240,7 @@ For safe code, the model returns:
|
|
| 238 |
"cwe": null,
|
| 239 |
"vulnerability_type": null,
|
| 240 |
"tainted_flow": null,
|
| 241 |
-
"explanation": "No injection vulnerability
|
| 242 |
"fix_suggestion": null
|
| 243 |
}
|
| 244 |
```
|
|
@@ -359,7 +361,7 @@ with our original synthetic generation. We gratefully acknowledge the dataset cr
|
|
| 359 |
these types is unknown.
|
| 360 |
- **CWE classification accuracy:** While detection (vulnerable vs. safe) is reliable,
|
| 361 |
the specific CWE label assigned to a detected vulnerability may be incorrect in some
|
| 362 |
-
cases — particularly between similar injection types (e.g. CWE-94 vs CWE-
|
| 363 |
- **Code context:** The model analyzes individual functions/snippets. It cannot trace
|
| 364 |
data flow across files or understand application-level sanitization.
|
| 365 |
- **Language coverage:** Primarily trained on Python, Java, PHP, C/C++, and JavaScript.
|
|
|
|
| 136 |
a human reviews each finding.
|
| 137 |
|
| 138 |
```python
|
| 139 |
+
import json
|
| 140 |
+
|
| 141 |
r = json.loads(response)
|
| 142 |
flow = r.get("tainted_flow") or {}
|
| 143 |
high_confidence = r.get("verdict") == "VULNERABLE" and flow.get("source") and flow.get("sink")
|
|
|
|
| 240 |
"cwe": null,
|
| 241 |
"vulnerability_type": null,
|
| 242 |
"tainted_flow": null,
|
| 243 |
+
"explanation": "No injection vulnerability is present; untrusted input is not passed unsanitized to a sensitive sink.",
|
| 244 |
"fix_suggestion": null
|
| 245 |
}
|
| 246 |
```
|
|
|
|
| 361 |
these types is unknown.
|
| 362 |
- **CWE classification accuracy:** While detection (vulnerable vs. safe) is reliable,
|
| 363 |
the specific CWE label assigned to a detected vulnerability may be incorrect in some
|
| 364 |
+
cases — particularly between similar injection types (e.g. CWE-94 code injection vs CWE-1336 template injection, or CWE-78 vs CWE-94).
|
| 365 |
- **Code context:** The model analyzes individual functions/snippets. It cannot trace
|
| 366 |
data flow across files or understand application-level sanitization.
|
| 367 |
- **Language coverage:** Primarily trained on Python, Java, PHP, C/C++, and JavaScript.
|