Skip to content

Security hardening from audit findings - #18

Merged
larkiny merged 2 commits into
mainfrom
fix/security-audit-hardening
Feb 14, 2026
Merged

Security hardening from audit findings#18
larkiny merged 2 commits into
mainfrom
fix/security-audit-hardening

Conversation

@larkiny

@larkiny larkiny commented Feb 13, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses all 4 findings from the security audit:

  • Path traversal guard on syncFile: Validates that resolved file paths stay within process.cwd() before writing. Adds a test proving ../../etc/passwd is rejected.
  • Type-safe LinkTransformContext fallback: Replaces {} as LinkTransformContext (empty object with phantom string properties) with a properly initialized default using the file's own sourcePath/targetPath.
  • npm audit in CI: Adds npm audit --audit-level=high to the GitHub Actions pipeline so high/critical dependency vulnerabilities block PRs.
  • .env in .gitignore: Prevents accidental commit of environment files containing GitHub tokens.

Test plan

  • tsc --noEmit passes
  • All 298 tests pass (297 existing + 1 new path traversal test)
  • ESLint clean
  • npm audit returns 0 vulnerabilities

Larkin Young 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
@larkiny
larkiny merged commit 793720e into main Feb 14, 2026
1 check passed
@larkiny
larkiny deleted the fix/security-audit-hardening branch February 14, 2026 10:23
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.

1 participant