Skip to content

Harden loop-action command execution against unquoted shell expansion - #404

Closed
cobusgreyling wants to merge 2 commits into
mainfrom
chore/merge-loop-action-harden-395
Closed

Harden loop-action command execution against unquoted shell expansion#404
cobusgreyling wants to merge 2 commits into
mainfrom
chore/merge-loop-action-harden-395

Conversation

@cobusgreyling

Copy link
Copy Markdown
Owner

Summary

Same change as #395 (from @amarjaleelbanbhan), re-hosted on a same-repo branch so required audit / validate checks can run (fork PR workflows were stuck in action_required).

inputs.command was spliced as raw text into the run: script before bash parsed it. For multi-line command: | blocks this silently broke sandbox isolation: only the first line reached loop-sandbox run -- ...; every later line executed as a bare top-level statement on the runner, bypassing the sandbox and circuit-breaker entirely.

Write command to a temp script (passed via env:, never re-templated by the workflow YAML) and invoke it as a single quoted bash -eo pipefail "$SCRIPT" call from both the sandbox and direct paths. Document safe usage and warn against embedding untrusted input in command in the README.

Closes #395 (supersedes / merges the same commits).

Attribution

Checklist

  • Security-sensitive command handling documented
  • Fail-fast (bash -eo pipefail) on all execution paths

inputs.command was spliced as raw text into the run: script before bash
parsed it. For multi-line command: | blocks this silently broke sandbox
isolation: only the first line reached loop-sandbox run -- ...; every
later line executed as a bare top-level statement on the runner,
bypassing the sandbox and circuit-breaker entirely.

Write command to a temp script (passed via env:, never re-templated by
the workflow YAML) and invoke it as a single quoted bash "$SCRIPT" call
from both the sandbox and direct paths. Document safe usage and warn
against embedding untrusted input in command in the README.
Run the temporary command script with bash -eo pipefail on the sandbox
and direct paths so an intermediate failure in a multi-line command
stops execution immediately and the step returns non-zero, instead of
continuing on to later lines. Drop the chmod +x on the script since
it's always invoked as an explicit argument to bash and never executed
directly. Document sandbox-shell as a loop-sandbox compatibility option
rather than something required for shell syntax in command.
@github-actions

Copy link
Copy Markdown
Contributor

Loop Readiness Audit

Score: 100/100 (L3)

Strong loop readiness — good candidate for L3 with explicit gates.

Top suggestions

  • Loop Ready 80+: version this loop for a fleet — npx @cobusgreyling/loop-init . --with-fleet
  • Loop Ready 80+: version this loop's memory — npx @cobusgreyling/loop-init . --with-memory
  • Loop Ready 80+: version this loop as a harness — npx @cobusgreyling/loop-init . --with-foundry · showcase https://github.com/cobusgreyling/harness-foundry/blob/main/docs/showcase.md
  • Scaffold a harness: npx @cobusgreyling/loop-init . --with-foundry (or npx @cobusgreyling/harness-foundry init --from loop-engineering:daily-triage)
  • Scaffold memory tiers: npx @cobusgreyling/loop-init . --with-memory

Posted by audit.yml · loop-audit docs

@cobusgreyling

Copy link
Copy Markdown
Owner Author

Superseded by merge of #395 (same commits; original author @amarjaleelbanbhan).

This same-repo branch was only opened so required checks could run while the fork PR’s workflows sat in action_required. Cleaning up.

@cobusgreyling
cobusgreyling deleted the chore/merge-loop-action-harden-395 branch July 27, 2026 09:21
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.

2 participants