You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validateOutputPath() in browse/src/meta-commands.ts:20 uses path.resolve() but never fs.realpathSync() to resolve symlinks. Unlike validateReadPath() (fixed in #595), a symlink placed under /tmp or cwd can redirect screenshot/PDF/responsive writes to arbitrary files.
validateReadPath was hardened with realpathSync in #595 (security audit remediation), but validateOutputPath was missed. The two functions have identical intent but divergent implementations.
Fix
PR #664 adds realpathSync to validateOutputPath, matching the validateReadPath pattern including symlink resolution on safe directories themselves (macOS /tmp → /private/tmp).
Found via sqry AST-based semantic code graph analysis.
Fixed in commits 1351cf7d + 73f5d0b7 (path-security.ts refactor). validateOutputPath now uses realpathSync on the parent directory. Additional file-level symlink check coming in the next security wave.
Activity
fix: resolve symlinks in validateOutputPath to prevent bypass (garryt…
fix: validateOutputPath symlink bypass — resolve real path before che…
garrytan commentedon Apr 13, 2026
Fixed in commits
1351cf7d+73f5d0b7(path-security.ts refactor).validateOutputPathnow usesrealpathSyncon the parent directory. Additional file-level symlink check coming in the next security wave.