Commit b724743
docs: use secure mktemp pattern instead of predictable temp files (#158)
## Description
Replace predictable temp file pattern `${FILE}.tmp.$$` with secure
`mktemp` pattern in documentation examples.
## Type of Change
- [x] Documentation update (improvements to README, CLAUDE.md, or
component docs)
## Component(s) Affected
- [x] Skills (methodology and best practices)
## Motivation and Context
The `${FILE}.tmp.$$` pattern is a known security anti-pattern because:
- `$$` (PID) is predictable and can be enumerated
- Attackers could pre-create symlinks to sensitive files
- Race conditions between check and use
While this is documentation (not executable code), it teaches developers
patterns they might copy into production scripts.
Fixes #153
## Solution
Replaced all 6 instances with secure `mktemp` pattern:
```bash
TEMP_FILE=$(mktemp) || exit 1
```
## Changes
| File | Instances |
|------|-----------|
| `parsing-techniques.md` | 3 (lines 202, 219, 228) |
| `real-world-examples.md` | 3 (lines 204, 295, 359) |
## Testing
- [x] Linting passes (markdownlint)
- [x] Verified no remaining `${FILE}.tmp.$$` patterns
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 52248e4 commit b724743
2 files changed
Lines changed: 13 additions & 12 deletions
File tree
- plugins/plugin-dev/skills/plugin-settings/references
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
202 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| |||
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
218 | | - | |
219 | | - | |
| 219 | + | |
| 220 | + | |
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
227 | | - | |
228 | | - | |
| 228 | + | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
| 203 | + | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
359 | | - | |
| 358 | + | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
0 commit comments