Skip to content

#382 minors: git-clean hardening (symlinked workspace, deep tree, grafts), test gaps, docs #411

Closed

Description

@scuttletoby

Minors from the two lenses on #382: state #382 (comment), security #382 (comment). Both SAFE; none of these is a blocker.

Hardening (security lens):

  1. git-clean empties what RUNNER_WORKSPACE points to when an earlier job made it a symlink (fork-ci/actions/git-clean/git_clean.py:149-158). Refuse a symlinked workspace (or resolve it and require it inside the runner's _work), and test it. The README's "nothing outside the workspace is touched" is wrong until then.
  2. A tree about 1100 folders deep crashes the wipe (git_clean.py:171-183; recursion). This fails safe, but blocks the runner until someone cleans it by hand. Use an iterative walk and add a test.
  3. The .git check reads only the config. info/grafts, info/attributes, objects/info/alternates and shallow still steer history when git-clean was skipped (--no-replace-objects does not turn off grafts; confirmed on git 2.43). Refuse these as pr_queue already does for its cache.
  4. The fixed git config does not stop ~/.config/git/attributes (git still reads it). Set XDG_CONFIG_HOME / core.attributesFile=/dev/null in the shared settings, as head_check already does.
  5. weakened-tests on a refusal (weakened-tests/action.yml:72-76): status is empty (reads as "did not run") and the previous head's report comment stays. Set a refused status and update or remove the old comment.
  6. Optional: in fork-pr-queue.yml queue (self-hosted, reused workspace), remove caller/ and toolkit/ before checkout (workflow change).

Correctness (state lens):
7. A git@host: submodule URL is wrongly refused (git_clean.py:63 allows only https; :50 allows git@ for origin). Also, the message at :224 says to run git-clean first, which is wrong when checkout itself wrote the key.
8. Absolute path is now refused by head-check, tested-base and weakened-tests. Note it in the docs or the "after merge" notes.

Test gaps (both lenses; each mutation stays green today):
9. The HOME and tool-cache guards (git_clean.py:159).
10. head-check checks its path input (changing head-check/action.yml:46 to . stays green).
11. The token header value, the UUID length, the exact include key, the submodule URL value, and the includeIf condition.

Docs (nits):
12. The git-clean README (line 14) leaves out weakened-tests and its write-nothing-on-refusal.
13. weakened-tests' status doc.
14. "Fork workflows run on GitHub-hosted runners": fork-tests can use one-job fleet runners.
15. "Costs nothing extra": every self-hosted job now does a full fetch.

Part of #83 follow-ups.

Activity

  1. scuttletoby commented on Nov 17, 2026

    @scuttletoby
    OwnerAuthor

    Reopened: #418 (merged as fc51266) fixed items 1-5 and 7-15. Item 6 is still open: remove caller/ and toolkit/ before the checkouts in the queue job of .github/workflows/fork-pr-queue.yml. A workflow-file PR is in progress for it ("Part of #411"); close this issue when that PR merges.

  2. scuttletoby commented on Nov 17, 2026

    @scuttletoby
    OwnerAuthor

    Item 6 done by #425 (merged as 3753e62): the queue job now removes caller/ and toolkit/ before the checkouts. All items are fixed; closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions