Commit 04851f4
fix: Add CSRF protection and fix token masking issues
Security Improvements:
- Add CSRF token validation for config POST requests
- Add /api/csrf endpoint to generate CSRF tokens
- Add unmask parameter to /api/config for internal API usage
- Fix token masking in Settings UI while keeping API functional
Bug Fixes:
- Fix "Disconnected" status caused by masked token
- Fix session token generation using crypto.randomBytes
- Fix XSS vulnerability in LogViewer component
- Fix path traversal in artifacts download
- Fix rate limiting to fail-closed
- Fix parseInt radix and NaN validation
- Fix memory exhaustion with batch processing
Testing:
- Add Jest testing framework with 26 unit tests
- Add auth.test.ts with password hashing tests
- Add logger.test.ts with sanitization tests
- All tests passing (100% pass rate)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 293eb72 commit 04851f4
File tree
16 files changed
+8083
-3574
lines changed- src
- app/api
- artifacts/download
- config
- csrf
- history
- export
- components
- lib
- __tests__
16 files changed
+8083
-3574
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments