Commit 781fdec
Your Name
security: add resource limits to config parser to prevent DoS
- Add maxConfigFileSize (5MB) and maxConfigKeys (10000) constants
- Check file size before YAML parsing in parse() function
- Check key count after unmarshaling in both parse() and parseRaw()
- Prevents memory/CPU exhaustion attacks via malicious config files
Fixes: Resource exhaustion vulnerability where attackers could crash
Nebula by providing extremely large configuration files1 parent fa8c013 commit 781fdec
1 file changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
| |||
369 | 376 | | |
370 | 377 | | |
371 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
372 | 384 | | |
373 | 385 | | |
374 | 386 | | |
| |||
382 | 394 | | |
383 | 395 | | |
384 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
385 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
386 | 408 | | |
387 | 409 | | |
388 | 410 | | |
| |||
0 commit comments