Commit cfb0f6c
test(cli): use mkdtempSync for runtime-assets temp dir
CodeQL flagged js/insecure-temporary-file (high) on the test: it built a
temp dir from a predictable `Date.now()` name and wrote into it, which is
open to a temp-file race / symlink attack in the shared OS temp dir.
Use fs.mkdtempSync() to atomically create a uniquely-named directory with
a random suffix — the pattern CodeQL recognizes as safe — and drop the now
redundant mkdirSync. Behavior is otherwise unchanged; all 3 tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 045fcf8 commit cfb0f6c
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | | - | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
0 commit comments