Skip to content

fix: restrict sync root paths to user home directory#12

Merged
hydro13 merged 3 commits intomainfrom
fix/sync-root-path-restriction
Mar 17, 2026
Merged

fix: restrict sync root paths to user home directory#12
hydro13 merged 3 commits intomainfrom
fix/sync-root-path-restriction

Conversation

@hydro13
Copy link
Owner

@hydro13 hydro13 commented Mar 17, 2026

Summary

  • normalizeExistingDirectoryPath accepted any valid directory on the filesystem as sync root (e.g. /etc, /var)
  • Added assertPathWithinRoot(os.homedir()) check so sync roots must be within the user's home directory
  • Resolves CodeQL alert #164 (path injection in security.ts:162)

Test plan

  • TypeScript compiles without errors
  • Setting sync root to a path inside home dir works
  • Setting sync root to a path outside home dir is rejected

hydro13 added 3 commits March 17, 2026 11:14
normalizeExistingDirectoryPath accepted any valid directory path on the
filesystem as a sync root. Added assertPathWithinRoot(os.homedir())
to ensure sync roots stay within the user's home directory.
@hydro13 hydro13 self-assigned this Mar 17, 2026
@hydro13 hydro13 merged commit 80ed168 into main Mar 17, 2026
4 checks passed
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