Summary
Issue 1: Arbitrary file upload in artifact server (GHSL-2023-004)
The /upload endpoint is vulnerable to path traversal as filepath is user controlled, and ultimately flows into os.Mkdir and os.Open.
router.PUT("/upload/:runId", func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {
itemPath := req.URL.Query().Get("itemPath")
runID := params.ByName("runId")
if req.Header.Get("Content-Encoding") == "gzip" {
itemPath += gzipExtension
}
filePath := fmt.Sprintf("%s/%s", runID, itemPath)
Issue 2: Arbitrary file download in artifact server (GHSL-2023-004)
The /artifact endpoint is vulnerable to path traversal as the path is variable is user controlled, and the specified file is ultimately returned by the server.
router.GET("/artifact/*path", func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {
path := params.ByName("path")[1:]
file, err := fsys.Open(path)
Proof of Concept
Below I have written a Github Action that will upload secret.txt into the folder above the specified artifact directory. The first call to curl will create the directory named 1 if it does not already exist, and the second call to curl will upload the secret.txt file to the directory above the specified artifact directory.
When testing this POC, the --artifact-server-path parameter must be passed to act in order to enable the artifact server.
Replace yourIPandPort with the IP and port of the server. An attacker can enumerate /proc/net/tcp in order to find the artifact server IP and port, but this is out of the scope of this report. Please let me know if you would like a copy of this script.
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: echo "Here are some secrets" > secret.txt
- run: curl http://<yourIPandPort>/upload/1?itemPath=secret.txt --upload-file secret.txt
- run: curl http://<yourIPandPort>/upload/1?itemPath=../../secret.txt --upload-file secret.txt
Patches
Version 0.2.40 contains a patch.
Workarounds
Avoid use of artifact server with --artifact-server-path
Impact
The artifact server that stores artifacts from Github Action runs does not sanitize path inputs. This allows an attacker to download and overwrite arbitrary files on the host from a Github Action. This issue may lead to privilege escalation.
Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.
CVE-2023-22726 has a CVSS score of 8.8 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.2.40); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
- During implementation of Open and OpenAtEnd for FS, please ensure to use ValidPath() to check against path traversal. See more here: https://pkg.go.dev/io/fs#FS
- Clean the user-provided paths manually
Frequently Asked Questions
- What is CVE-2023-22726? CVE-2023-22726 is a high-severity path traversal vulnerability in github.com/nektos/act (go), affecting versions <= 0.2.39. It is fixed in 0.2.40. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
- How severe is CVE-2023-22726? CVE-2023-22726 has a CVSS score of 8.8 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/nektos/act are affected by CVE-2023-22726? github.com/nektos/act (go) versions <= 0.2.39 is affected.
- Is there a fix for CVE-2023-22726? Yes. CVE-2023-22726 is fixed in 0.2.40. Upgrade to this version or later.
- Is CVE-2023-22726 exploitable, and should I be worried? Whether CVE-2023-22726 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2023-22726 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2023-22726? Upgrade
github.com/nektos/actto 0.2.40 or later.