Skip to content

fix(template): reject symbolic links - #205

Merged
ralyodio merged 1 commit into
moshcoder:mainfrom
rissrice2105-agent:fix/template-symlink-safety
Aug 1, 2026
Merged

fix(template): reject symbolic links#205
ralyodio merged 1 commit into
moshcoder:mainfrom
rissrice2105-agent:fix/template-symlink-safety

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Summary

  • identify symbolic links and special entries while planning a template install
  • reject the whole template before writing any destination file
  • preflight every planned source as a regular file before copying
  • add a synthetic-data regression for the symlink path

Security impact

Remote templates are advertised as inert files, but the previous copy path followed symbolic links. A template could therefore copy a readable local file into the generated project. This change rejects links instead of dereferencing them.

Tests

  • node --test test/templates.test.mjs - 15 passed, 1 skipped on Windows because creating symlinks requires elevated privileges
  • full node --test - 622 passed, 194 skipped, 18 existing Windows/shell failures unrelated to templates
  • git diff --check

Closes #204

@ralyodio
ralyodio merged commit c96f7aa into moshcoder:main Aug 1, 2026
3 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.

template: installer follows symbolic links outside the source tree

2 participants