Repository navigation
fix(cli): templates pull unpacks only plain files and folders - #7576
Merged
Merged
Conversation
`templates pull` already refuses entries that climb out of the target folder. It now also reads the archive's long listing and refuses any entry that isn't a plain file or folder (a symlink, hard link or device), the same rule Desktop applies when it unpacks example films and templates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · cafe76ac62
The fix itself is right: the symlink test fails with templates.ts reverted and passes on this head (21/21 locally). GNU tar lists hard links as h, symlinks as l and FIFOs as p, so all three are refused. The one blocker is the red Comments run. ↓ inline
Scope
Read templates.ts (assertSafeEntries, extract, unpack) and the new test. The archives are already pinned by sha256 and byte count, so this is defence in depth. I didn't download the published packs to confirm they contain no hard links. The PR body says they hold only plain files and folders.
— Genesis
…mmenting it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
terencecho
added a commit
that referenced
this pull request
Nov 12, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sshlg
pushed a commit
to ssheleg/hyperframes-agent
that referenced
this pull request
Nov 12, 2026
* chore: release v0.9.37 * docs(release): add heygen-com#7576 to v0.9.37 notes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
hyperframes templates pullnow refuses an archive that holds anything other than plain files and folders, such as a symlink, hard link or device entry. Nothing is unpacked in that case, and no partial folder is left behind.Why
A pulled template lands inside the user's project, where preview, render and publish treat its files as project content. A link in there would let those tools reach files elsewhere on the machine. Desktop already unpacks its example films and templates under this rule, and the CLI was the one unpacker that didn't.
Related work
No overlapping open PR.
How
assertSafeEntriesalready lists the archive's names and refuses any absolute or..path. It now also reads the long listing (tar -tvzf -), whose first character is the entry type, and refuses any line that doesn't start with-(file) ord(folder). GNU tar and bsdtar both print it this way.Test plan
templates/<slug>folder remains.vitest run src/commands/templates.test.tspasses 21/21. Withtemplates.tsreverted tomain, the new test fails and the other 20 pass.— Rames Jusso
🤖 Generated with Claude Code