Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tj-actions/verify-changed-files action to v11 [SECURITY] #497

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 2, 2024

Mend Renovate

This PR contains the following updates:

Package Type Update Change
tj-actions/verify-changed-files action major v10 -> v11

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 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

  1. Submit a pull request to the repository with a new file injecting a command. For example $(whoami).txt would be a valid filename.
  2. 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: $"

Example output:

##[group]Run echo "Changed files: $(whoami).txt"
  echo "Changed files: $(whoami).txt"�[0m
shell: /usr/bin/bash -e {0}

##[endgroup]
Changed files: runner.txt

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.

- name: List all changed files tracked and untracked files
  env:
     CHANGED_FILES: $
  run: |
    echo "Changed files: $CHANGED_FILES"

Resources


Release Notes

tj-actions/verify-changed-files (tj-actions/verify-changed-files)

v11

Compare Source

🔥 🔥 BREAKING CHANGE 🔥 🔥

What's Changed

Full Changelog: tj-actions/verify-changed-files@v10.1...v11


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, 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 has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added automerge dependencies Pull requests that update a dependency file labels Jan 2, 2024
@renovate renovate bot closed this Apr 4, 2024
@renovate renovate bot deleted the renovate/github-tags-tj-actions/verify-changed-files-vulnerability branch April 4, 2024 13:44
Copy link
Contributor Author

renovate bot commented Apr 4, 2024

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 11.x releases. But if you manually upgrade to 11.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant