Skip to content

temportal 0.5.1: the checkpoint stays in .claude's own repository, and the push check, notices and writes hold against a hostile project - #270

Merged
ezexe merged 2 commits into
mainfrom
fix/temportal-security
Dec 2, 2026

Conversation

@ezexe

@ezexe ezexe commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

What

Fixes the seven findings of the security review of temportal.sh and pre-push.tmpl.

  • T1 (high): the checkpoint could commit in the repository around the project when .claude/.git was broken or GIT_DIR was in the hook's environment. Every call on .claude's repository names its git directory and work tree, the GIT_* variables are unset, and a write needs git to resolve to .claude/.git.
  • T2 (critical, narrow reach): a .claude/.git that arrived with a project had its config and hooks run. temportal reads .claude/.git/config itself before it runs git there, and runs git only when every key is on a list of keys that cannot name a program. Any other repository is foreign and left alone, and session start and status name the key that stopped it. temportal's own git calls turn off fsmonitor, hooks and signing.
  • T3 (high): the pre-push check let a matching value through in merge commits, forced pushes over an unknown tip, binary files and pushes to a second remote, and was silently absent when core.hooksPath was set.
  • T4 (medium): tool input was printed raw into temportal's notices, and a tool response could forge calls.
  • T5 (medium): writes followed symlinks inside .claude/.
  • T6 (low-medium): a project path was written into settings.local.json unescaped.
  • T7 (low): a nested repository with a space or glob character in its name was committed as a gitlink.
  • Found on the way: a nested repository held as a gitlink in .claude's index had git run inside it, with its own config, on status, add and commit. The checkpoint takes such links out of the index and excludes the nested repository.

What a user sees

  • A repository git init made keeps working with no step, and nothing is written outside the project.
  • A .claude/.git/config with a key off the list (for example core.fsmonitor, filter.*, alias.*, include.path) stops temportal there until the key is taken out.
  • A repository that held a nested repository as a link gets one checkpoint that records the link's removal.

Checked

vibe5/tests/temportal/temportal.test.sh: 507 passed in Git Bash, 511 under dash in WSL Ubuntu (gawk), 510 under dash with mawk in Debian with no network; 0 failed in each. The new script's status reads this repository's own .claude/ as repository. Not run: a real Claude Code session, claude plugin validate, macOS.

🤖 Generated with Claude Code

ezexe and others added 2 commits December 2, 2026 21:52
…d the push check, notices and writes hold against a hostile project

A project can come from anyone, and whoever sent it wrote its .claude/.git, its file names, its links and what its
tools answer.

- Git's own variables (GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE and the like) are dropped when the script starts, and
  every call on .claude's repository names the git directory and the work tree, so no commit lands in a repository
  further up. Nothing is written unless git takes .claude/.git for the repository named to it.
- temportal runs git in a .claude/.git only when it made that repository on this machine or the user adopted it. An
  id in .claude/.git/temportal/made and the same id in temportal/made under Claude Code's own directory say so, and
  no project can write the second. Any other .claude/.git is reported and left alone, as status says with
  claude=unadopted, until the user runs the new adopt command. A repository made by 0.5.0 is such a one, since
  nothing in it tells it from one that was shipped: it takes one adopt.
- Its calls there run with the repository's hooks, a file system monitor and commit signing off.
- The pre-push hook sets a merge against each parent, reads files git takes for binary, falls back to what the
  remote being pushed to is known to hold when this clone lacks the remote's commit, counts only that remote's
  branches, takes a named value on the line after its name, and refuses a push whose commits it cannot read.
  temportal says once when core.hooksPath or a hook of the user's keeps its hook from being installed, and replaces
  only a hook whose second line is its own.
- A call's signature is shown in a note between << and >>, cut at 120 characters and with a ? for every character
  outside a small set, and the note says it is quoted text. The batch hook reads tool_name and tool_input only as
  members of the input and of each element of tool_calls, and the transcript reader reads no call from an entry in
  the role of the user.
- Nothing is written through a symbolic link at settings.json, settings.local.json, memory or anything under
  .claude/temportal, and json_set writes to a file it creates itself.
- json_set writes its value as JSON writes a string.
- A nested repository whose name holds a space or a pattern's characters gets an exclude line that names it.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
…eft alone, and one that git init made is kept as it is

Before temportal runs git in a .claude/.git it reads that repository's config itself, as a file, with one awk, and
runs git there only when every key is on a list of keys that can name no program and bring in no other config: the
keys git init writes and their like, user.name and user.email, commit.gpgsign when false, init.defaultBranch, a
branch's remote, merge and rebase, a remote's url, pushurl and fetch, the gc settings that time packing and pruning,
and the object format and ref storage git init can write. A config that is a link, a config.worktree or a commondir
beside it, a line that cannot be read as git reads it, or any other key makes the state foreign: no git is run
there, nothing is written and nothing is committed, session start tells the user which key it was, and status says
the same on a line of its own. With the key out of the config the repository is kept.

This takes the place of the list of repositories under Claude Code's own directory and of the command, the state
and the files that went with it. Nothing is written outside the project, and a repository that git init made needs
no step from its user.

A repository inside .claude/ that the index holds as a link is taken out of the index before and after staging, and
status is asked to pass such links by: git would otherwise run git inside that repository, with its own config.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
@ezexe
ezexe merged commit a3f3cce into main Dec 2, 2026
5 checks passed
@ezexe
ezexe deleted the fix/temportal-security branch December 2, 2026 21:44
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