Commit a1be60e
fix: add URL validation to prevent SSRF in bench.py and pydantic_models_to_grammar_examples.py
- Added URL validation before HTTP requests
- Blocks localhost and private IP ranges
- Prevents Server-Side Request Forgery (SSRF) attacks
Addresses 2 SSRF vulnerabilities (CWE-918)
Co-Authored-By: Jake Cosme <[email protected]>1 parent 41b5567 commit a1be60e
File tree
2 files changed
+22
-0
lines changed- examples
- tools/server/bench
2 files changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
28 | 39 | | |
29 | 40 | | |
30 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
312 | 323 | | |
313 | 324 | | |
314 | 325 | | |
| |||
0 commit comments