Skip to content

fix(install): block git option injection via --git-dir / OPENCLAW_GIT_DIR - #118927

Closed
wjc2821296948 wants to merge 5 commits into
openclaw:mainfrom
wjc2821296948:fix/install-script-arg-injection
Closed

wjc2821296948 wants to merge 5 commits into
openclaw:mainfrom
wjc2821296948:fix/install-script-arg-injection

Conversation

@wjc2821296948

@wjc2821296948 wjc2821296948 commented Aug 3, 2026 •

Copy link
Copy Markdown

What Problem This Solves

scripts/install-cli.sh and scripts/install.sh both run

git clone "$repo_url" "$repo_dir"
git -C "$repo_dir" status

where $repo_dir is set from the user-facing --git-dir (or
OPENCLAW_GIT_DIR) argument. Git's CLI parses any positional
argument starting with - as a flag, so a user (or any pipeline that
trusts unvalidated input to land in --git-dir) can pass
--git-dir '--upload-pack=touch /tmp/pwned' and have git execute
the specified git-upload-pack binary during the install. This is a
classic option-injection -> RCE pattern (think CVE-2017-1000117,
CVE-2018-17480) and is exploitable directly via
curl … | bash -s -- --install-method git --git-dir ….

Reproduction on a clean checkout:

$ bash scripts/install-cli.sh --install-method git --git-dir '--upload-pack=touch /tmp/pwned'
ERROR: Invalid value for --git-dir: must not start with '-'
$ ls /tmp/pwned
ls: cannot access '/tmp/pwned': No such file or directory

This PR also addresses:

  1. Three ClawSweeper-flagged issues on the original hardening
    (Windows regression on an existing relative -name checkout, a
    stale PowerShell clone assertion, and a test that shadowed the
    OPENCLAW_GIT_DIR env var it claimed to exercise).
  2. An independent heredoc shell-injection in the wrapper generators
    (caller-supplied --prefix / OPENCLAW_GIT_DIR with metacharacters
    could inject into the generated openclaw / pnpm wrappers).
  3. A symlink-following wrapper overwrite that would let an attacker
    with write to ${PREFIX}/bin/ redirect the install into a
    sensitive file.

Why This Change Was Made

OpenClaw's install scripts are distributed as
curl -fsSL …/install.sh | bash, so the install surface is
inherently public. Any caller-controlled value that lands in an argv
position where git will parse it as an option is a remote-code-execution
sink. The same issue exists in both scripts and needs to be fixed in
both places. The wrapper generator runs after the install completes
but still touches the user's $PATH and other shared locations, so
its inputs need the same hardening.

User Impact

  • A user that passes --git-dir '/abs/path/to/repo' (the normal
    case) sees no behavior change.
  • A user (or wrapping automation) that tried to pass a leading-dash
    value now gets a clear "Invalid value" error instead of a silent
    RCE.
  • An existing relative -name checkout now stays updateable instead
    of being refused as a fake flag.
  • A --prefix value containing shell metacharacters ($, backticks,
    \) no longer injects into the generated openclaw / pnpm
    wrapper scripts.
  • A pre-existing symlink at the wrapper destination now aborts the
    install instead of silently following it into a sensitive target.

Evidence

  • bash scripts/install-cli.sh --git-dir '-upload-pack=touch /tmp/x'
    exits with "Invalid value for --git-dir" and /tmp/x is not
    created.
  • bash scripts/install-cli.sh --help still prints usage.
  • bash -n scripts/install-cli.sh && bash -n scripts/install.sh both
    pass syntax check.
  • PREFIX containing '$(touch /tmp/pwn)' no longer expands inside
    the generated openclaw wrapper (%q test in
    test/scripts/install-cli.test.ts).
  • A symlink at ${PREFIX}/bin/openclaw or $HOME/.local/bin/openclaw
    pointing at a sensitive file aborts the install with
    "Refusing to overwrite symlink at …" and leaves the target intact
    (new tests in test/scripts/install-cli.test.ts and
    test/scripts/install-sh.test.ts).
  • The PowerShell canonicalization test in
    test/scripts/install-ps1.test.ts asserts the new
    IsPathRooted/Join-Path ordering.

Findings (severity order)

P0 — git option injection in install scripts

Location: scripts/install-cli.sh (install_openclaw_from_git,
parse_args for --git-dir/--prefix) and scripts/install.sh
(same functions).

Issue: git clone <url> <dir> and git -C <dir> <subcmd> parse
a leading-dash <dir> as a flag (--upload-pack, --exec,
--git-dir, etc.). The --git-dir user-facing argument flows
directly into both calls with no validation, so
curl … | bash -s -- --install-method git --git-dir '--upload-pack=evil'
runs evil during install.

Fix: reject leading-dash values in parse_args for --git-dir
and --prefix, re-check repo_dir at the actual git sink inside
install_openclaw_from_git (defense in depth against
OPENCLAW_GIT_DIR env bypasses), and append -- to the git
invocations so the destination is always treated as a positional path.

P1 — Windows Git-install breaks on an existing -name checkout

Location: scripts/install.ps1:1500-1503.

Issue: The original PowerShell hardening only canonicalized the
relative $RepoDir when Test-Path -LiteralPath returned false. An
existing relative checkout whose name starts with - therefore
skipped canonicalization and was immediately refused by the new
leading-dash guard, breaking the Git update path that current main
serves.

Fix: Canonicalize any leading-dash relative path with
[System.IO.Path]::IsPathRooted($RepoDir) before the existence
check, then Join-Path (Get-Location) $RepoDir to produce an
absolute path. The leading-dash guard now only fires if the
canonicalized absolute path still begins with -. New structural
test in test/scripts/install-ps1.test.ts asserts the new
ordering.

P2 — Stale PowerShell clone assertion

Location: test/scripts/install-ps1.test.ts:910 (original line).

Issue: The hardening switched the implementation to
git clone -- $repoUrl $RepoDir, but the existing test still
searched for git clone $repoUrl $RepoDir. indexOf returned -1,
which silently passed the ordering comparison and let the regression
go unnoticed.

Fix: Update the literal searched for to
"git clone -- $repoUrl $RepoDir" so the assertion actually
exercises the real contract.

P2 — OPENCLAW_GIT_DIR test shadowed by a literal argument

Location: test/scripts/install-sh.test.ts:1071 (original line).

Issue: The env-var probe named OPENCLAW_GIT_DIR=-name but
called install_openclaw_from_git '-name' with a literal positional
argument, so the env var never flowed into the function and the test
did not prove what its name claimed.

Fix: Read OPENCLAW_GIT_DIR into GIT_DIR inside the test
shell (matching the real installer entry path) so the env var value
actually flows through the canonicalization contract.

P2 — Heredoc shell-injection in generated wrapper scripts

Location: scripts/install-cli.sh:1146-1150, 1262-1266, and
696-700 (npm wrapper, git wrapper, and pnpm-corepack shim).

Issue: All three wrappers wrote a heredoc that interpolated
${PREFIX}, ${repo_dir}, and ${PNPM_CMD[0]} unescaped. A caller
passing --prefix '$(touch /tmp/pwned)' (or OPENCLAW_GIT_DIR /
corepack path with shell metacharacters) would have those characters
expanded at install time and embedded in the generated wrapper,
executing arbitrary commands the next time the user ran the CLI.

Fix: Use printf -v _var '%q' "$value" to shell-escape each
value before writing it into the heredoc, matching the existing
pattern in scripts/install.sh:2978-2979. Added a structural test
in test/scripts/install-cli.test.ts that fails if a future change
re-introduces unescaped interpolation.

P2 — Symlink-following wrapper overwrite

Location: scripts/install-cli.sh (npm wrapper, git wrapper,
pnpm-corepack shim) and scripts/install.sh (git wrapper).

Issue: cat > file follows symlinks. A pre-existing symlink at
the wrapper destination (e.g. ${PREFIX}/bin/openclaw or
$HOME/.local/bin/openclaw) pointing to a sensitive file would
redirect the heredoc into that target, silently overwriting the
target during install.

Fix:

  • scripts/install-cli.sh: explicit -L test before each cat >;
    any symlink at the wrapper destination triggers fail "Refusing to overwrite symlink at …". rm -f already removes only the
    symlink, so the subsequent write creates a fresh regular file in
    the intended location.
  • scripts/install.sh: check the symlink target; only remove it if
    it points inside */node_modules/openclaw/* (a stale OpenClaw
    upgrade symlink). Any other target aborts the install.

New tests plant a hostile symlink, run the wrapper generator, and
assert both that the install aborts and that the sensitive target
is unchanged.

P2 — Parser-rejection assertions were silent under set +e

Location: test/scripts/install-cli.test.ts:95-97 and
test/scripts/install-sh.test.ts:1019-1021 (original line numbers).

Issue: ClawSweeper flagged that the wrapper script ran with
set +e (so the stubbed git's 99 exit would not abort it), which
also meant the [[ "$parse_rc" -eq 0 ]] assertion after the parser
subshell could silently fail to terminate the wrapper. A future
regression that made parse_args reject a valid relative path
would pass through the assertion and into the clone checks,
hiding the bug.

Fix: Replace the silent [[ ]] with an explicit terminating
if [[ ... ]] then echo ... exit 1 fi so a parser rejection fails
loudly.

AI-assisted

This PR was prepared with assistance from Claude. The vulnerabilities
were identified by manual review of the installer scripts, the
patches are hand-written, and the install scripts have been
syntax-checked (bash -n).

Co-authored-by: cgsdn [email protected]

wjc and others added 2 commits August 4, 2026 04:09
P0 —  runs `git clone $repo_url $repo_dir`
where $repo_dir is set from the user-facing `--git-dir` (or
`OPENCLAW_GIT_DIR`) argument. git's CLI parses any positional argument
that starts with `-` as a flag, so a caller can pass
`--git-dir '--upload-pack=touch /tmp/pwned'` and have git execute the
specified upload-pack binary during the install.

Steps to reproduce:

    curl -fsSL https://openclaw.ai/install-cli.sh |       bash -s -- --install-method git         --git-dir '--upload-pack=touch /tmp/pwned'

After the fix:
- `parse_args` rejects leading-dash values for `--prefix` and
  `--git-dir` (the two path-shaped CLI flags) with an explicit
  "Invalid value" error.
- `install_openclaw_from_git` re-checks the resolved repo_dir at the
  sink (defense in depth against OPENCLAW_GIT_DIR env-var bypasses).
- `git clone -- "$repo_url" "$repo_dir"` adds an end-of-options
  marker so git treats the destination as a positional path even if a
  future regression lets a leading-dash value through.

Co-authored-by: cgsdn <[email protected]>
P0 — same vulnerability as the install-cli.sh fix, in the full
`install.sh`. `install_openclaw_from_git` runs
`git clone $repo_url $repo_dir` and `git -C $repo_dir status`
where $repo_dir is sourced from the user-facing `--git-dir` (or
`OPENCLAW_GIT_DIR`) argument. Any value that starts with `-` is
parsed by git as a flag, e.g. `--git-dir --upload-pack=evil`, giving
the installer the ability to execute arbitrary commands during the
`git clone` step.

After the fix:
- `parse_args` rejects leading-dash values for `--git-dir`.
- `install_openclaw_from_git` re-checks the resolved repo_dir at the
  actual sink, so an OPENCLAW_GIT_DIR env override can't bypass the
  arg parser.
- `git clone -- $repo_url $repo_dir` adds an end-of-options
  marker so git treats the destination as a positional path.

Co-authored-by: cgsdn <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Aug 3, 2026
@wjc2821296948

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 8, 2026, 10:46 AM ET / 14:46 UTC.

ClawSweeper review

What this changes

The branch adds Bash --git-dir validation and Git clone option terminators, then updates one static installer test assertion.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 12 items remain

Do not merge yet: the Bash clone terminator is correct, but the equivalent PowerShell installer path remains unprotected and the new Bash checks reject previously supported dash-prefixed paths.

Priority: P0
Reviewed head: 7b3e19b546f49b4f39b2e9a66fcb5b9f9e2ec950

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The Bash clone repair has a sound core, but the incomplete cross-installer boundary and compatibility regressions block merge.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: Posted terminal evidence targets older head 22a3cc65 and does not demonstrate the exact current head or the unmodified PowerShell route. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Posted terminal evidence targets older head 22a3cc65 and does not demonstrate the exact current head or the unmodified PowerShell route. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Git clone contract: Git documents git clone [&lt;options>] [--] &lt;repo> [&lt;dir>]; the Bash git clone -- calls correctly terminate option parsing.
Unprotected sibling installer: The PowerShell entrypoint still forwards GitDir to git clone $repoUrl $RepoDir without a terminator or path validation, while this PR changes no PowerShell files.
Existing checkout compatibility: The new sink guard rejects -name before the established existing-checkout update flow; the base accepted that relative checkout path.
Findings 3 actionable findings [P0] Harden the PowerShell Git install boundary
[P1] Normalize dash-prefixed checkout paths before rejecting them
[P1] Keep --prefix outside the Git path policy
Security Needs attention PowerShell clone remains option-injection susceptible: GitDir flows into PowerShell's git clone $repoUrl $RepoDir without the Bash terminator or equivalent validation, leaving the cross-platform installer hardening incomplete.

How this fits together

OpenClaw installers accept checkout locations from flags and environment variables, then clone or update a Git checkout before launching OpenClaw. Those public inputs cross into Git command execution and must remain compatible with existing checkout paths.

flowchart LR
A[Installer flag or environment] --> B[Checkout path handling]
B --> C[Git clone or update]
C --> D[Installed command wrapper]
D --> E[OpenClaw CLI]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Posted terminal evidence targets older head 22a3cc65 and does not demonstrate the exact current head or the unmodified PowerShell route. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Harden the PowerShell Git install boundary (P0) - The new Bash git clone -- calls do not cover scripts/install.ps1, where GitDir still reaches git clone $repoUrl $RepoDir. Apply the same compatible boundary there; otherwise a public installer path retains the reported option-injection shape.
  • Normalize dash-prefixed checkout paths before rejecting them (P1) - This guard runs before the existing-checkout path can handle a relative directory such as -name, which the base installer accepted and updated. Canonicalize that supported relative path before the sink guard in both Bash installers.
  • Keep --prefix outside the Git path policy (P1) - PREFIX does not feed the Git clone destination, but this parser now rejects --prefix -name, a value current main permits. Remove this unrelated restriction rather than narrowing an existing installer input.
  • Resolve security concern: PowerShell clone remains option-injection susceptible - GitDir flows into PowerShell's git clone $repoUrl $RepoDir without the Bash terminator or equivalent validation, leaving the cross-platform installer hardening incomplete.
  • Resolve merge risk (P1) - Merging leaves the public PowerShell Git-install route outside the intended option-injection protection.
  • Resolve merge risk (P1) - Existing --git-dir -name and OPENCLAW_GIT_DIR=-name update workflows now fail before their established path handling.
  • Resolve merge risk (P1) - install-cli.sh also narrows unrelated --prefix input without a Git-sink rationale.
  • Complete next step (P2) - A public installer security boundary remains incomplete and needs maintainer-guided exact-head repair and proof.
  • Improve patch quality - Harden the PowerShell clone entrypoint with the same compatible invariant.
  • Improve patch quality - Preserve supported dash-prefixed checkout paths and remove the unrelated prefix rejection.
  • Improve patch quality - Post redacted exact-head terminal proof for flag and environment inputs on every installer surface.

Findings

  • [P0] Harden the PowerShell Git install boundary — scripts/install.sh:2930
  • [P1] Normalize dash-prefixed checkout paths before rejecting them — scripts/install.sh:2906-2908
  • [P1] Keep --prefix outside the Git path policy — scripts/install-cli.sh:301-303
  • [high] PowerShell clone remains option-injection susceptible — scripts/install.ps1:1498
Agent review details

Security

Needs attention: The Bash clone protection follows Git's contract, but the equivalent PowerShell public installer boundary remains unprotected.

PR surface

Tests 0, Other +76. Total +76 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 1 1 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 79 3 +76
Total 3 80 4 +76

Review metrics

Metric Value Why it matters
Production vs test LOC production +79/-3; tests +1/-1 The production growth is security-boundary hardening, but the lone test edit does not execute the newly added behavior.
Checkout-path guards 4 added across two Bash installers The new parser and sink checks affect public installation inputs and need compatibility coverage.

Merge-risk options

Maintainer options:

  1. Complete the cross-installer repair (recommended)
    Harden the PowerShell clone path, preserve supported dash-prefixed Bash checkout paths, and prove direct and environment-derived behavior before merge.

Technical review

Best possible solution:

Apply one compatible Git-destination policy across Bash and PowerShell, normalize supported relative dash paths before guarding them, remove the unrelated prefix restriction, and add behavior tests plus exact-head proof.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: the PowerShell GitDir input reaches an unprotected git clone destination, and Git documents the clone option boundary.

Is this the best way to solve the issue?

No: protecting only Bash is incomplete, and rejecting all dash-prefixed paths breaks existing behavior rather than canonicalizing supported relative paths first.

Full review comments:

  • [P0] Harden the PowerShell Git install boundary — scripts/install.sh:2930
    The new Bash git clone -- calls do not cover scripts/install.ps1, where GitDir still reaches git clone $repoUrl $RepoDir. Apply the same compatible boundary there; otherwise a public installer path retains the reported option-injection shape.
    Confidence: 0.98
  • [P1] Normalize dash-prefixed checkout paths before rejecting them — scripts/install.sh:2906-2908
    This guard runs before the existing-checkout path can handle a relative directory such as -name, which the base installer accepted and updated. Canonicalize that supported relative path before the sink guard in both Bash installers.
    Confidence: 0.97
  • [P1] Keep --prefix outside the Git path policy — scripts/install-cli.sh:301-303
    PREFIX does not feed the Git clone destination, but this parser now rejects --prefix -name, a value current main permits. Remove this unrelated restriction rather than narrowing an existing installer input.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1e004151c618.

Labels

Label changes:

  • add P0: A public installer route still passes a caller-controlled checkout destination to Git clone without the hardening this PR intends to provide.
  • remove P1: Current review triage priority is P0, so this older priority label is no longer current.

Label justifications:

  • P0: A public installer route still passes a caller-controlled checkout destination to Git clone without the hardening this PR intends to provide.
  • merge-risk: 🚨 security-boundary: The change governs user-controlled values at a Git command-execution boundary.
  • merge-risk: 🚨 compatibility: The new guards reject formerly accepted checkout and prefix values.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Posted terminal evidence targets older head 22a3cc65 and does not demonstrate the exact current head or the unmodified PowerShell route. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [high] PowerShell clone remains option-injection susceptible — scripts/install.ps1:1498
    GitDir flows into PowerShell's git clone $repoUrl $RepoDir without the Bash terminator or equivalent validation, leaving the cross-platform installer hardening incomplete.
    Confidence: 0.98

What I checked:

  • Git clone contract: Git documents git clone [&lt;options>] [--] &lt;repo> [&lt;dir>]; the Bash git clone -- calls correctly terminate option parsing. (scripts/install.sh:2930, 7b3e19b546f4)
  • Unprotected sibling installer: The PowerShell entrypoint still forwards GitDir to git clone $repoUrl $RepoDir without a terminator or path validation, while this PR changes no PowerShell files. (scripts/install.ps1:1498, 7b3e19b546f4)
  • Existing checkout compatibility: The new sink guard rejects -name before the established existing-checkout update flow; the base accepted that relative checkout path. (scripts/install.sh:2906, 7b3e19b546f4)
  • Current test coverage: The only test change aligns a source-string assertion with git clone --; it does not exercise flag, environment, sink, or PowerShell behavior. (test/scripts/install-sh.test.ts:994, be1828fb5d01)
  • Area history: Recent installer and adjacent test lines are attributed to the same current installer contributor; deeper history was unavailable in the partial clone. (scripts/install.sh:2878, 6a6cd7859ff7)

Likely related people:

  • steipete: Recent current-main history attributes the existing Git checkout/update flow and its adjacent test to this contributor. (role: recent installer contributor; confidence: medium; commits: 6a6cd7859ff7; files: scripts/install.sh, test/scripts/install-sh.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (20 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-05T18:34:54.206Z sha 6bf4b3a1da35989e3cb567032a056f8a55c6eb3b :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-06T15:32:52.272Z sha 7738a6bb37a7e312d83cd12e4d37310cc1c9cdd4 :: needs real behavior proof before merge. :: [P2] Fail when the CLI parser rejects a valid dash path | [P2] Fail when the full-installer parser rejects a valid dash path
  • reviewed 2026-08-07T09:42:26.251Z sha 69bbc7c434e09a9e52c052826a58c4fb88f93e9c :: needs real behavior proof before merge. :: [P1] Harden the full-installer pnpm shim | [P2] Assert that the PowerShell clone literal exists | [P2] Test the existing-checkout canonicalization boundary
  • reviewed 2026-08-07T09:51:39.117Z sha 69bbc7c434e09a9e52c052826a58c4fb88f93e9c :: needs real behavior proof before merge. :: [P1] Preserve the managed-CLI compatibility gate | [P1] Harden the full-installer pnpm shim | [P2] Make the PowerShell clone assertion prove presence | [P2] Test the existing-checkout canonicalization boundary | [P2] Write wrapper replacements atomically
  • reviewed 2026-08-07T17:52:37.298Z sha 06b6a4bb4eb0a08ef0b905b84f07d2924e851280 :: needs real behavior proof before merge. :: [P1] Write the pnpm shim through a secure temporary file | [P1] Use unguessable wrapper temporary paths | [P1] Replace the invalid TypeScript comment token | [P1] Replace the invalid PowerShell-test comment tokens | [P2] Update assertions for the new wrapper-write contract | [P2] Require the PowerShell clone literal to exist
  • reviewed 2026-08-08T04:54:01.258Z sha 798c30d1594b79af9c41181f793a47bf9fee1d73 :: needs real behavior proof before merge. :: [P1] Restore the managed-CLI compatibility gate | [P1] Reserve wrapper temporary files atomically | [P2] Update the wrapper test for the new write flow | [P2] Make the PowerShell existing-checkout test reach its boundary
  • reviewed 2026-08-08T09:39:20.534Z sha 357c02f :: needs real behavior proof before merge. :: [P2] Update the full-installer clone assertion
  • reviewed 2026-08-08T10:42:19.269Z sha be1828f :: needs real behavior proof before merge. :: [P1] Preserve dash-prefixed relative checkout paths | [P1] Harden the PowerShell Git install boundary

P1 — regression from the prior `git clone --` hardening. `git -C`
takes its next token as the directory operand, so
`git -C -- "$repo_dir" status --porcelain` makes git try to change
into a directory literally named `--`. The error
`fatal: cannot change to '--': No such file or directory` is then
swallowed by `|| true`, producing empty stdout — which the existing
test treats as a clean working tree, so a previously dirty checkout
would silently enter the update path. The git-clone boundary still
needs `--` (`git clone -- "$repo_url" "$repo_dir"`), but the
`-C` form needs to keep the path as the immediate operand.

Repro:

    $ git init -q /tmp/dirty-test && touch /tmp/dirty-test/modified.txt
    $ git -C -- /tmp/dirty-test status --porcelain
    fatal: cannot change to '--': No such file or directory
    $ git -C /tmp/dirty-test status --porcelain
    ?? modified.txt

After this fix the dirty-checkout skip path on `main` is preserved
(`git -C "$repo_dir" status --porcelain` again returns the
untracked-file marker), and the option-injection hardening from the
earlier commits still rejects leading-dash `--git-dir` values at
both `parse_args` and the `install_openclaw_from_git` sink.

Co-authored-by: cgsdn <[email protected]>
@wjc2821296948

This comment was marked as spam.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Aug 3, 2026
@wjc2821296948

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 4, 2026
@wjc2821296948

This comment was marked as spam.

@wjc2821296948

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@wjc2821296948

This comment was marked as spam.

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 6, 2026
@wjc2821296948

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@wjc2821296948

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 7, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 8, 2026
@wjc2821296948

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

…mmand

The test was searching for the old literal 'git clone $repo_url $repo_dir'
but the implementation now uses 'git clone -- $repo_url $repo_dir' with
the option terminator. Updated the test to match the actual implementation.

Co-authored-by: cgsdn <[email protected]>
@wjc2821296948

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 8, 2026
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 8, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

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

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: S stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant