github-slug-action vulnerable to arbitrary code execution
High severity
GitHub Reviewed
Published
Mar 13, 2023
in
rlespinasse/github-slug-action
•
Updated Apr 16, 2024
Package
Affected versions
>= 4.0.0, < 4.4.1
Patched versions
4.4.1
Description
Published to the GitHub Advisory Database
Mar 13, 2023
Reviewed
Mar 13, 2023
Published by the National Vulnerability Database
Mar 13, 2023
Last updated
Apr 16, 2024
Impact
This action uses the
github.head_ref
parameter in an insecure way.This vulnerability can be triggered by any user on GitHub on any workflow using the action on pull requests. They just need to create a pull request with a branch name, which can contain the attack payload. (Note that first-time PR requests will not be run - but the attacker can submit a valid PR before submitting an invalid PR). This can be used to execute code on the GitHub runners (potentially use it for crypto-mining, and waste your resources) and to exfiltrate any secrets you use in the CI pipeline.
Patches
Patched action is available on tag v4, tag v4.4.1, and any tag beyond.
Workarounds
No workaround is available if impacted, please upgrade the version
References
Here is a set of blog posts by Github's security team explaining this issue.
Thanks
Thanks to the team of researchers from Purdue University, who are working on finding vulnerabilities in CI/CD configurations of open-source software. Their tool detected this security vulnerability.
References