Skip to content

fix: remove eval, stop printing secrets to logs, pin actions [E-1815]#2

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

fix: remove eval, stop printing secrets to logs, pin actions [E-1815]#2
jonathansantilli merged 1 commit intomainfrom
action/E-1815

Conversation

@jonathansantilli
Copy link
Copy Markdown
Collaborator

@jonathansantilli jonathansantilli commented Apr 7, 2026

Summary

  • Remove eval "$python_cmd" — call python directly with env vars
  • Remove echo "$python_cmd" that printed SONARQUBE_TOKEN in plaintext to workflow logs
  • Remove bare env command that dumped all environment variables to logs
  • Move all ${{ inputs.* }} from run: blocks to env: blocks
  • Move github-token from curl command line to env var
  • Replace bash -l {0} with bash
  • Quote all variable expansions
  • Pin all action references to immutable commit SHAs

Security Context

Line 94 (echo "$python_cmd") prints a string containing SONARQUBE_TOKEN=<actual-token> to the workflow log every time the action runs. On public repos, anyone can read Actions logs.

The consumer .github/scripts/sonarqube_download_report.py already reads from os.environ — the fix simply sets the env vars via the env: block instead of via eval inline assignment. No changes needed to the python script.

Consumer Impact

None. The action inputs: and outputs: are unchanged. The python script receives the same environment variables. This fix is transparent.

Test plan

The injection test evidence is documented in detail at: mobb-dev/action#31 (comment)

Security fix for secret leakage and command injection (CWE-78).

Changes:
- Remove eval "$python_cmd" — call python directly with env vars
- Remove echo "$python_cmd" that printed SONARQUBE_TOKEN to logs
- Remove bare `env` command that dumped all secrets to logs
- Move all ${{ inputs.* }} from run: blocks to env: blocks
- Move github-token from curl command line to env var
- Replace bash -l {0} with bash
- Quote all variable expansions
- Pin all action references to immutable commit SHAs:
  - actions/setup-node v3.6.0 -> v4.4.0 (SHA pinned)
  - actions/checkout v3 -> v4.3.1 (SHA pinned)
  - guibranco/github-status-action-v2 v1.1.13 (SHA pinned)

The python script (.github/scripts/sonarqube_download_report.py) already
reads from os.environ — no changes needed to consumer scripts.

The action interface (inputs/outputs) is unchanged — this fix is
transparent to consumers.

Ref: E-1815
@jonathansantilli jonathansantilli merged commit 5d5ef9f into main Apr 8, 2026
@jonathansantilli jonathansantilli deleted the action/E-1815 branch April 8, 2026 10:10
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