The tj-actions/verify-changed-files action allows for command injection in changed filenames, allowing an attacker to execute arbitrary code and potentially leak secrets.
Details
The verify-changed-files workflow returns the list of files changed within a workflow execution.
This could potentially allow filenames that contain special characters such as ; and ` (backtick) which can be used by an attacker to take over the GitHub Runner if the output value is used in a raw fashion (thus being directly replaced before execution) inside a run block. By running custom commands an attacker may be able to steal secrets such as GITHUB_TOKEN if triggered on other events than pull_request. For example on push.
Proof of Concept
Submit a pull request to the repository with a new file injecting a command. For example $(whoami).txt would be a valid filename.
Upon approval of the workflow (triggered by the pull request), the action will get executed and the malicious pull request filename will flow into the List all changed files tracked and untracked files step.
- name: List all changed files tracked and untracked files
run: |
echo "Changed files: $"
This issue may lead to arbitrary command execution in the GitHub Runner.
Resolution
A new safe_output input would be enabled by default and return filename paths escaping special characters like ;, ` (backtick), $, (), etc for bash environments.
A safe recommendation of using environment variables to store unsafe outputs.
- name: List all changed files tracked and untracked files
env:
CHANGED_FILES: $
run: |
echo "Changed files: $CHANGED_FILES"
tj-actions/verify-changed-files (tj-actions/verify-changed-files)
### [`v16`](https://togithub.com/tj-actions/verify-changed-files/releases/tag/v16)
[Compare Source](https://togithub.com/tj-actions/verify-changed-files/compare/v15...v16)
### Changes in v16.1.1
#### What's Changed
- Upgraded to v16.1.0 by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/335](https://togithub.com/tj-actions/verify-changed-files/pull/335)
- chore(deps): update actions/checkout digest to [`8ade135`](https://togithub.com/tj-actions/verify-changed-files/commit/8ade135) by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/336](https://togithub.com/tj-actions/verify-changed-files/pull/336)
- chore(deps): update actions/checkout action to v4.1.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/337](https://togithub.com/tj-actions/verify-changed-files/pull/337)
- chore(deps): update tj-actions/auto-doc action to v3.1.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/338](https://togithub.com/tj-actions/verify-changed-files/pull/338)
- fix: use of deprecated set output by [@jackton1](https://togithub.com/jackton1) in [https://github.com/tj-actions/verify-changed-files/pull/341](https://togithub.com/tj-actions/verify-changed-files/pull/341)
- fix: bug with detecting deleted files by [@jackton1](https://togithub.com/jackton1) in [https://github.com/tj-actions/verify-changed-files/pull/342](https://togithub.com/tj-actions/verify-changed-files/pull/342)
- chore: test detecting deleted unstaged files by [@jackton1](https://togithub.com/jackton1) in [https://github.com/tj-actions/verify-changed-files/pull/340](https://togithub.com/tj-actions/verify-changed-files/pull/340)
**Full Changelog**: https://github.com/tj-actions/verify-changed-files/compare/v16...v16.1.1
***
### Changes in v16.1.0
#### What's Changed
- Upgraded to v16.0.1 by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/317](https://togithub.com/tj-actions/verify-changed-files/pull/317)
- chore(deps): update tj-actions/auto-doc action to v2.8.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/318](https://togithub.com/tj-actions/verify-changed-files/pull/318)
- chore(deps): update tj-actions/auto-doc action to v2.9.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/319](https://togithub.com/tj-actions/verify-changed-files/pull/319)
- chore(deps): update tj-actions/auto-doc action to v3 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/322](https://togithub.com/tj-actions/verify-changed-files/pull/322)
- Updated README.md by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/323](https://togithub.com/tj-actions/verify-changed-files/pull/323)
- chore(deps): update actions/checkout action to v3.6.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/324](https://togithub.com/tj-actions/verify-changed-files/pull/324)
- chore(deps): update tj-actions/release-tagger action to v4 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/325](https://togithub.com/tj-actions/verify-changed-files/pull/325)
- Add `fail-if-changed` option by [@Minecraftschurli](https://togithub.com/Minecraftschurli) in [https://github.com/tj-actions/verify-changed-files/pull/321](https://togithub.com/tj-actions/verify-changed-files/pull/321)
- docs: add Minecraftschurli as a contributor for code, doc, and test by [@allcontributors](https://togithub.com/allcontributors) in [https://github.com/tj-actions/verify-changed-files/pull/327](https://togithub.com/tj-actions/verify-changed-files/pull/327)
- Updated README.md by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/328](https://togithub.com/tj-actions/verify-changed-files/pull/328)
- Updated README.md by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/329](https://togithub.com/tj-actions/verify-changed-files/pull/329)
- docs: add stefanhoth as a contributor for code by [@allcontributors](https://togithub.com/allcontributors) in [https://github.com/tj-actions/verify-changed-files/pull/330](https://togithub.com/tj-actions/verify-changed-files/pull/330)
- fix(github-actions): Remove old output syntax by [@stefanhoth](https://togithub.com/stefanhoth) in [https://github.com/tj-actions/verify-changed-files/pull/326](https://togithub.com/tj-actions/verify-changed-files/pull/326)
- Updated README.md by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/331](https://togithub.com/tj-actions/verify-changed-files/pull/331)
- chore(deps): update actions/checkout action to v4 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/332](https://togithub.com/tj-actions/verify-changed-files/pull/332)
- chore(deps): update reviewdog/action-shellcheck action to v1.19 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/333](https://togithub.com/tj-actions/verify-changed-files/pull/333)
- chore(deps): update tj-actions/auto-doc action to v3.0.1 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/334](https://togithub.com/tj-actions/verify-changed-files/pull/334)
#### New Contributors
- [@Minecraftschurli](https://togithub.com/Minecraftschurli) made their first contribution in [https://github.com/tj-actions/verify-changed-files/pull/321](https://togithub.com/tj-actions/verify-changed-files/pull/321)
- [@stefanhoth](https://togithub.com/stefanhoth) made their first contribution in [https://github.com/tj-actions/verify-changed-files/pull/326](https://togithub.com/tj-actions/verify-changed-files/pull/326)
**Full Changelog**: https://github.com/tj-actions/verify-changed-files/compare/v16...v16.1.0
***
### Changes in v16.0.1
#### What's Changed
- Upgraded to v16 by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/314](https://togithub.com/tj-actions/verify-changed-files/pull/314)
- chore(deps): update tj-actions/verify-changed-files action to v16 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/315](https://togithub.com/tj-actions/verify-changed-files/pull/315)
- chore(deps): update tj-actions/auto-doc action to v2.7.1 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/316](https://togithub.com/tj-actions/verify-changed-files/pull/316)
**Full Changelog**: https://github.com/tj-actions/verify-changed-files/compare/v16...v16.0.1
***
### Changes in v16.0.0
#### What's Changed
- chore(deps): update tj-actions/glob action to v17 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/312](https://togithub.com/tj-actions/verify-changed-files/pull/312)
- Upgraded to v15.0.2 by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/313](https://togithub.com/tj-actions/verify-changed-files/pull/313)
**Full Changelog**: https://github.com/tj-actions/verify-changed-files/compare/v15...v16.0.0
***
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
v15
->v16
GitHub Vulnerability Alerts
CVE-2023-52137
Summary
The
tj-actions/verify-changed-files
action allows for command injection in changed filenames, allowing an attacker to execute arbitrary code and potentially leak secrets.Details
The
verify-changed-files
workflow returns the list of files changed within a workflow execution.This could potentially allow filenames that contain special characters such as
;
and ` (backtick) which can be used by an attacker to take over the GitHub Runner if the output value is used in a raw fashion (thus being directly replaced before execution) inside arun
block. By running custom commands an attacker may be able to steal secrets such asGITHUB_TOKEN
if triggered on other events thanpull_request
. For example onpush
.Proof of Concept
$(whoami).txt
would be a valid filename.List all changed files tracked and untracked files
step.Example output:
Impact
This issue may lead to arbitrary command execution in the GitHub Runner.
Resolution
A new
safe_output
input would be enabled by default and return filename paths escaping special characters like ;, ` (backtick), $, (), etc for bash environments.A safe recommendation of using environment variables to store unsafe outputs.
Resources
Release Notes
tj-actions/verify-changed-files (tj-actions/verify-changed-files)
### [`v16`](https://togithub.com/tj-actions/verify-changed-files/releases/tag/v16) [Compare Source](https://togithub.com/tj-actions/verify-changed-files/compare/v15...v16) ### Changes in v16.1.1 #### What's Changed - Upgraded to v16.1.0 by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/335](https://togithub.com/tj-actions/verify-changed-files/pull/335) - chore(deps): update actions/checkout digest to [`8ade135`](https://togithub.com/tj-actions/verify-changed-files/commit/8ade135) by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/336](https://togithub.com/tj-actions/verify-changed-files/pull/336) - chore(deps): update actions/checkout action to v4.1.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/337](https://togithub.com/tj-actions/verify-changed-files/pull/337) - chore(deps): update tj-actions/auto-doc action to v3.1.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/338](https://togithub.com/tj-actions/verify-changed-files/pull/338) - fix: use of deprecated set output by [@jackton1](https://togithub.com/jackton1) in [https://github.com/tj-actions/verify-changed-files/pull/341](https://togithub.com/tj-actions/verify-changed-files/pull/341) - fix: bug with detecting deleted files by [@jackton1](https://togithub.com/jackton1) in [https://github.com/tj-actions/verify-changed-files/pull/342](https://togithub.com/tj-actions/verify-changed-files/pull/342) - chore: test detecting deleted unstaged files by [@jackton1](https://togithub.com/jackton1) in [https://github.com/tj-actions/verify-changed-files/pull/340](https://togithub.com/tj-actions/verify-changed-files/pull/340) **Full Changelog**: https://github.com/tj-actions/verify-changed-files/compare/v16...v16.1.1 *** ### Changes in v16.1.0 #### What's Changed - Upgraded to v16.0.1 by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/317](https://togithub.com/tj-actions/verify-changed-files/pull/317) - chore(deps): update tj-actions/auto-doc action to v2.8.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/318](https://togithub.com/tj-actions/verify-changed-files/pull/318) - chore(deps): update tj-actions/auto-doc action to v2.9.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/319](https://togithub.com/tj-actions/verify-changed-files/pull/319) - chore(deps): update tj-actions/auto-doc action to v3 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/322](https://togithub.com/tj-actions/verify-changed-files/pull/322) - Updated README.md by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/323](https://togithub.com/tj-actions/verify-changed-files/pull/323) - chore(deps): update actions/checkout action to v3.6.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/324](https://togithub.com/tj-actions/verify-changed-files/pull/324) - chore(deps): update tj-actions/release-tagger action to v4 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/325](https://togithub.com/tj-actions/verify-changed-files/pull/325) - Add `fail-if-changed` option by [@Minecraftschurli](https://togithub.com/Minecraftschurli) in [https://github.com/tj-actions/verify-changed-files/pull/321](https://togithub.com/tj-actions/verify-changed-files/pull/321) - docs: add Minecraftschurli as a contributor for code, doc, and test by [@allcontributors](https://togithub.com/allcontributors) in [https://github.com/tj-actions/verify-changed-files/pull/327](https://togithub.com/tj-actions/verify-changed-files/pull/327) - Updated README.md by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/328](https://togithub.com/tj-actions/verify-changed-files/pull/328) - Updated README.md by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/329](https://togithub.com/tj-actions/verify-changed-files/pull/329) - docs: add stefanhoth as a contributor for code by [@allcontributors](https://togithub.com/allcontributors) in [https://github.com/tj-actions/verify-changed-files/pull/330](https://togithub.com/tj-actions/verify-changed-files/pull/330) - fix(github-actions): Remove old output syntax by [@stefanhoth](https://togithub.com/stefanhoth) in [https://github.com/tj-actions/verify-changed-files/pull/326](https://togithub.com/tj-actions/verify-changed-files/pull/326) - Updated README.md by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/331](https://togithub.com/tj-actions/verify-changed-files/pull/331) - chore(deps): update actions/checkout action to v4 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/332](https://togithub.com/tj-actions/verify-changed-files/pull/332) - chore(deps): update reviewdog/action-shellcheck action to v1.19 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/333](https://togithub.com/tj-actions/verify-changed-files/pull/333) - chore(deps): update tj-actions/auto-doc action to v3.0.1 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/334](https://togithub.com/tj-actions/verify-changed-files/pull/334) #### New Contributors - [@Minecraftschurli](https://togithub.com/Minecraftschurli) made their first contribution in [https://github.com/tj-actions/verify-changed-files/pull/321](https://togithub.com/tj-actions/verify-changed-files/pull/321) - [@stefanhoth](https://togithub.com/stefanhoth) made their first contribution in [https://github.com/tj-actions/verify-changed-files/pull/326](https://togithub.com/tj-actions/verify-changed-files/pull/326) **Full Changelog**: https://github.com/tj-actions/verify-changed-files/compare/v16...v16.1.0 *** ### Changes in v16.0.1 #### What's Changed - Upgraded to v16 by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/314](https://togithub.com/tj-actions/verify-changed-files/pull/314) - chore(deps): update tj-actions/verify-changed-files action to v16 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/315](https://togithub.com/tj-actions/verify-changed-files/pull/315) - chore(deps): update tj-actions/auto-doc action to v2.7.1 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/316](https://togithub.com/tj-actions/verify-changed-files/pull/316) **Full Changelog**: https://github.com/tj-actions/verify-changed-files/compare/v16...v16.0.1 *** ### Changes in v16.0.0 #### What's Changed - chore(deps): update tj-actions/glob action to v17 by [@renovate](https://togithub.com/renovate) in [https://github.com/tj-actions/verify-changed-files/pull/312](https://togithub.com/tj-actions/verify-changed-files/pull/312) - Upgraded to v15.0.2 by [@tj-actions-bot](https://togithub.com/tj-actions-bot) in [https://github.com/tj-actions/verify-changed-files/pull/313](https://togithub.com/tj-actions/verify-changed-files/pull/313) **Full Changelog**: https://github.com/tj-actions/verify-changed-files/compare/v15...v16.0.0 ***Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.