docs: use secure mktemp pattern instead of predictable temp files#158
docs: use secure mktemp pattern instead of predictable temp files#158
Conversation
Replace 6 instances of predictable temp file pattern `${FILE}.tmp.$$`
with secure `mktemp` pattern. The PID-based pattern is a known security
anti-pattern (predictable names, symlink attacks, race conditions).
Changed files:
- parsing-techniques.md: 3 instances
- real-world-examples.md: 3 instances
Fixes #153
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @sjnims's task in 1m 18s —— View job PR Review Complete ✅SummaryApproved - This is an excellent security improvement to the documentation examples. What's Good
Code Review Detailsparsing-techniques.md changes:
real-world-examples.md changes:
The changes are consistent and follow the same secure pattern throughout. Checklist Verification
RecommendationMerge this PR. This is a well-executed security improvement that enhances the educational value of the documentation. The changes are thorough, consistent, and follow security best practices. |
Description
Replace predictable temp file pattern
${FILE}.tmp.$$with securemktemppattern in documentation examples.Type of Change
Component(s) Affected
Motivation and Context
The
${FILE}.tmp.$$pattern is a known security anti-pattern because:$$(PID) is predictable and can be enumeratedWhile 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
mktemppattern:Changes
parsing-techniques.mdreal-world-examples.mdTesting
${FILE}.tmp.$$patterns🤖 Generated with Claude Code