Skip to content

fix: use env command for bash array execution [E-1815]#33

Merged
jonathansantilli merged 1 commit intomainfrom
fix/E-1815
Apr 8, 2026
Merged

fix: use env command for bash array execution [E-1815]#33
jonathansantilli merged 1 commit intomainfrom
fix/E-1815

Conversation

@jonathansantilli
Copy link
Copy Markdown
Collaborator

@jonathansantilli jonathansantilli commented Apr 8, 2026

Summary

Fixes the autofixer test failure introduced by the security fix in PR #31.

The change is a one-line fix in both action.yml and review/action.yml:

- OUT=$("${MOBB_ARGS[@]}")
+ OUT=$(env "${MOBB_ARGS[@]}")

Root Cause

The autofixer test suite uses act to run the action locally. It replaces npx --yes mobbdev@latest with API_URL=http://localhost:8080/v1/graphql node .../dist/index.mjs via sed.

PR #31 replaced eval $MobbExecString with bash array execution ("${MOBB_ARGS[@]}"). This is correct for security (prevents shell injection), but bash arrays don't support inline VAR=value command syntax, bash treats API_URL=http://... as a command name instead of an env var assignment.

The env command handles this correctly:

  • Normal use: env npx --yes mobbdev@latest review ... — works
  • Test override: env API_URL=http://... node .../index.mjs review ... — works

Test plan

  • autofixer CI test passes (Mobb Github Action Tests)
  • Normal workflow on this repo still works

…ments

The autofixer test suite uses act to run the action locally and replaces
npx --yes mobbdev@latest with API_URL=http://... node .../dist/index.mjs
via sed.

Bash arrays don't support inline VAR=value command syntax (the VAR=value
is treated as a command name, not an env var assignment). The env command
handles this correctly, passing the variable to the child process.

This works for both:
- Normal use: env npx --yes mobbdev@latest review ...
- Test override: env API_URL=http://... node .../index.mjs review ...

Ref: E-1815
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

image No security issues were found ✅

Awesome! No vulnerabilities were found by CodeQL in the changes made as part of this PR.
Please notice there are issues in this repo that are unrelated to this PR.

@jonathansantilli jonathansantilli merged commit bf76c59 into main Apr 8, 2026
4 checks passed
@jonathansantilli jonathansantilli deleted the fix/E-1815 branch April 8, 2026 17:26
jonathansantilli added a commit that referenced this pull request Apr 8, 2026
jonathansantilli added a commit that referenced this pull request Apr 8, 2026
…-1815] (#35)

* Revert "fix: use env command for array execution to support inline var assignments (#33)"

This reverts commit bf76c59.

* Revert "fix: prevent shell injection via eval in action.yml and review/action.yml [E-1815] (#31)"

This reverts commit a12bce4.

* fix: extract URL from mobbdev CLI output

The mobbdev CLI now prefixes its output with status messages like
"[WebSocket Mode] Using WebSocket subscription..." before the URL.
Extract just the https:// URL using grep.

Ref: E-1815
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