Skip to content

security: use safe temp directory in std usage example - #334

Merged
codeforester merged 1 commit into
mainfrom
security/331-20260820-security-replace-the-predictable-temp-path-in-std-usage-sh
Aug 20, 2026
Merged

security: use safe temp directory in std usage example#334
codeforester merged 1 commit into
mainfrom
security/331-20260820-security-replace-the-predictable-temp-path-in-std-usage-sh

Conversation

@codeforester

@codeforester codeforester commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the PID-derived temp path in examples/std-usage.sh with an exclusively created private temp directory.
  • Add a dedicated adversarial symlink regression test for the shipped example.
  • Register the new example suite in validation and lint contracts.

Issue

Fixes #331

Validation

  • bats tests/examples.bats
  • ./examples/std-usage.sh
  • ./tests/validate.sh
  • ./tests/lint-warnings.sh
  • git diff --check

Security Notes

The example no longer derives a writable path from the shell PID. The private directory is created exclusively by the stdlib and is cleaned up by its ownership-aware cleanup contract.

@codeforester
codeforester merged commit 4fb698c into main Aug 20, 2026
10 checks passed
@codeforester
codeforester deleted the security/331-20260820-security-replace-the-predictable-temp-path-in-std-usage-sh branch August 20, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: replace the predictable temp path in std-usage.sh

1 participant