Commit d2d8986
committed
cli/context/store: cap tls file size on zip import
`io.ReadAll(f)` on the decompressed tls/* entries was unbounded, so a
zip whose compressed archive is within the 10 MiB outer cap could still
decompress to multi-gigabyte TLS files and OOM the CLI. The meta.json
branch right above already wraps its reader in limitedReader, this just
mirrors it for the tls branch.
Also fast-fails on the advertised UncompressedSize64 before calling
zf.Open, so a well-formed zip bomb is rejected without any decompression
at all. limitedReader still guards the stream in case the header lies.
Fixes #6917
Signed-off-by: texasich <texasich@users.noreply.github.com>1 parent 792293c commit d2d8986
2 files changed
Lines changed: 43 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
477 | 483 | | |
478 | 484 | | |
479 | 485 | | |
480 | 486 | | |
481 | | - | |
| 487 | + | |
| 488 | + | |
482 | 489 | | |
483 | 490 | | |
484 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
214 | 249 | | |
215 | 250 | | |
216 | 251 | | |
| |||
0 commit comments