Commit d3c3ab6
SDK-6180 proxyCaCertificate: harden temp trust-anchor file (mkdtemp + 0600 + O_EXCL)
Security review flagged the predictable temp path used for NODE_EXTRA_CA_CERTS when
converting a DER cert. Now write into a fresh owner-only dir (fs.mkdtempSync) and open
the file with O_EXCL|O_NOFOLLOW at mode 0600, preventing a local pre-plant/symlink-race
on the file the process trusts as a CA.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent fb6c617 commit d3c3ab6
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
97 | 106 | | |
98 | 107 | | |
99 | 108 | | |
| |||
0 commit comments