Skip to content

fix(dsl): confine native read sources - #840

Open
rustytrees wants to merge 1 commit into
indaco:mainfrom
rustytrees:security/dsl-read-confinement
Open

fix(dsl): confine native read sources#840
rustytrees wants to merge 1 commit into
indaco:mainfrom
rustytrees:security/dsl-read-confinement

Conversation

@rustytrees

@rustytrees rustytrees commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

Pathname.read and both native inreplace paths now open sources through confined, no-follow descriptors. Reads stay bound to the checked object, so direct outside paths and final-component symlinks cannot import host-file bytes into the prefix.

Regression tests cover direct Pathname reads, final symlink reads, DSL inreplace, and declarative inreplace.

Related Issue

Closes #850.

Notes for Reviewers

Verification completed:

  • Focused DSL builtins: 66 passed
  • zig build test-one: 2,426 passed
  • zig build test: 5,063 passed, 3 skipped
  • Commit signature verified with git verify-commit

Open Pathname and inreplace sources through confined no-follow descriptors, then read from those descriptors. This prevents formula steps from importing bytes through direct outside paths or final-component symlinks.
@indaco

indaco commented Aug 13, 2026

Copy link
Copy Markdown
Owner

@rustytrees Thanks for the contribution! One small request: could you please instruct your agent to follow the PR template provided in the repository for PRs? It helps keep the PRs consistent and easier to review. Thanks!

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: native read and inreplace paths can import files from outside the prefix

2 participants