Commit 07a123e
Secure cache directory creation to prevent TOCTOU race conditions (#283)
Modified `Path.mkdir()` calls in `qwen3_embed/common/utils.py` and
`qwen3_embed/common/model_management.py` to explicitly set `mode=0o700`.
This prevents a Time-of-Check to Time-of-Use (TOCTOU) vulnerability
where temporary directories were created with default umask permissions
and subsequently restricted using a `chmod` call, leaving a brief window
where unauthorized processes could interact with the directory contents.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 3cb68f5 commit 07a123e
2 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
0 commit comments