Commit 0af6f0e
fix(dashboard-api): reject newlines and null bytes in env editor values
Adds validation in _serialize_form_values to reject values containing
\n, \r, or \0. Prevents .env injection where a value like
"3010\nINJECTED_KEY=malicious" could write an extra line to .env.
Not exploitable in the current architecture (Docker Compose and Python
dotenv treat values as literal strings), but closes a defense-in-depth
gap identified during the #854 security audit.
Adds 2 tests: newline injection rejected (400), null byte rejected (400).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 551598d commit 0af6f0e
File tree
2 files changed
+38
-0
lines changed- dream-server/extensions/services/dashboard-api
- tests
2 files changed
+38
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
523 | 529 | | |
524 | 530 | | |
525 | 531 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
0 commit comments