Security hardening from audit findings - #18
Merged
Conversation
added 2 commits
February 13, 2026 17:28
- Add path traversal guard to syncFile: reject paths that resolve
outside process.cwd() (defense-in-depth)
- Fix {} as LinkTransformContext: provide properly initialized default
context using file's own sourcePath/targetPath instead of empty object
- Add npm audit --audit-level=high to CI pipeline
- Add .env and .env.* to .gitignore to prevent accidental credential commits
- Add test for path traversal rejection in syncFile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses all 4 findings from the security audit:
syncFile: Validates that resolved file paths stay withinprocess.cwd()before writing. Adds a test proving../../etc/passwdis rejected.LinkTransformContextfallback: Replaces{} as LinkTransformContext(empty object with phantom string properties) with a properly initialized default using the file's ownsourcePath/targetPath.npm auditin CI: Addsnpm audit --audit-level=highto the GitHub Actions pipeline so high/critical dependency vulnerabilities block PRs..envin.gitignore: Prevents accidental commit of environment files containing GitHub tokens.Test plan
tsc --noEmitpassesnpm auditreturns 0 vulnerabilities