Skip to content

Reject source paths outside srcDir - #22

Draft
YoungJinJung wants to merge 1 commit into
mainfrom
issue-17-source-containment
Draft

Reject source paths outside srcDir#22
YoungJinJung wants to merge 1 commit into
mainfrom
issue-17-source-containment

Conversation

@YoungJinJung

Copy link
Copy Markdown
Contributor

Summary

  • Canonicalize srcDir and validate every explicit or glob-resolved source file before reading it.
  • Reject traversal, absolute-path, and symlink escape attempts that resolve outside srcDir.
  • Add a regression test for ../outside.js source traversal.

Closes #17.

Validation

  • npm test
  • node --check quarkify.mjs

@YoungJinJung

Copy link
Copy Markdown
Contributor Author

Cross-platform note: #27 adds the Windows/macOS/Linux CI matrix that should validate this change across supported operating systems before release.

Source file entries now resolve under the canonical srcDir before Quarkify reads them. Traversal, absolute paths, and symlink escapes are rejected so generated output cannot accidentally materialize files outside the intended source tree.

Constraint: Preserve existing relative and glob source file behavior.
Rejected: Silently skip escaped paths | hiding configuration mistakes can still leak when paths are later corrected or symlinked.
Confidence: high
Scope-risk: moderate
Directive: Keep source containment checks on both explicit and glob-resolved files.
Tested: npm test; node --check quarkify.mjs
Related: #17
@YoungJinJung
YoungJinJung force-pushed the issue-17-source-containment branch from 0c4fea6 to 66e39e6 Compare June 16, 2026 07:44
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.

Reject sourceFiles that resolve outside srcDir

1 participant