{"id":"CVE-2023-22726","aliases":["CVE-2023-22726","GHSA-pc99-qmg4-rcff","GO-2023-1504"],"related":[],"kind":"vulnerability","state":"published","title":"Unrestricted file upload leading to privilege escalation in act","summary":"act is a project which allows for local running of github actions. 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. The /upload endpoint is vulnerable to path traversal as filepath is user controlled, and ultimately flows into os.Mkdir and os.Open. 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. This has been addressed in version 0.2.40. Users are advised to upgrade. Users unable to upgrade may, during implementation of Open and OpenAtEnd for FS, ensure to use ValidPath() to check against path traversal or clean the user-provided paths manually.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"act is a project which allows for local running of github actions. 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. The /upload endpoint is vulnerable to path traversal as filepath is user controlled, and ultimately flows into os.Mkdir and os.Open. 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. This has been addressed in version 0.2.40. Users are advised to upgrade. Users unable to upgrade may, during implementation of Open and OpenAtEnd for FS, ensure to use ValidPath() to check against path traversal or clean the user-provided paths manually.","source":"cvelist"},{"lang":"en","text":"### Impact\nThe 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.\n\n\n#### Issue 1: Arbitrary file upload in artifact server (GHSL-2023-004)\nThe [/upload endpoint](https://github.com/nektos/act/blob/v0.2.35/pkg/artifacts/server.go#LL103C2-L103C2) is vulnerable to path traversal as filepath is user controlled, and ultimately flows into os.Mkdir and os.Open.\n\n```\nrouter.PUT(\"/upload/:runId\", func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {\n\t\titemPath := req.URL.Query().Get(\"itemPath\")\n\t\trunID := params.ByName(\"runId\")\n\n\t\tif req.Header.Get(\"Content-Encoding\") == \"gzip\" {\n\t\t\titemPath += gzipExtension\n\t\t}\n\n\t\tfilePath := fmt.Sprintf(\"%s/%s\", runID, itemPath)\n```\n\n#### Issue 2: Arbitrary file download in artifact server (GHSL-2023-004)\nThe [/artifact endpoint](https://github.com/nektos/act/blob/v0.2.35/pkg/artifacts/server.go#L245) is vulnerable to path traversal as the path is variable is user controlled, and the specified file is ultimately returned by the server.\n\n```\nrouter.GET(\"/artifact/*path\", func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {\n\t\tpath := params.ByName(\"path\")[1:]\n\n\t\tfile, err := fsys.Open(path)\n```\n\n#### Proof of Concept\nBelow 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.\n\nWhen testing this POC, the `--artifact-server-path` parameter must be passed to act in order to enable the artifact server.\nReplace 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.\n\n```\nname: CI\non: push\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n    - run: echo \"Here are some secrets\" > secret.txt\n    - run: curl http://<yourIPandPort>/upload/1?itemPath=secret.txt --upload-file secret.txt\n    - run: curl http://<yourIPandPort>/upload/1?itemPath=../../secret.txt --upload-file secret.txt\n```\n\n### Remediation\n1. During implementation of [Open and OpenAtEnd for FS](https://github.com/nektos/act/blob/master/pkg/artifacts/server.go#L65), please ensure to use ValidPath() to check against path traversal. See more here: https://pkg.go.dev/io/fs#FS\n2. Clean the user-provided paths manually\n\n### Patches\nVersion 0.2.40 contains a patch.\n\n### Workarounds\nAvoid use of artifact server with `--artifact-server-path`","format":"markdown","source":"ghsa"},{"lang":"en","text":"act vulnerable to arbitrary file upload in artifact server in github.com/nektos/act","format":"markdown","source":"go"},{"lang":"es","text":"act es un proyecto que permite la ejecución local de acciones de github. El servidor de artefactos que almacena artefactos de las ejecuciones de Github Action no sanitiza  las entradas de ruta. Esto permite a un atacante descargar y sobrescribir archivos arbitrarios en el host desde una Github Action. Este problema puede provocar una escalada de privilegios. El endpoint /upload es vulnerable a path traversal, ya que la ruta del archivo está controlada por el usuario y, en última instancia, fluye hacia os.Mkdir y os.Open. El endpoint /artifact es vulnerable a path traversal, ya que la ruta es variable y está controlada por el usuario y, en última instancia, el servidor devuelve el archivo especificado. Esto se ha solucionado en la versión 0.2.40. Se recomienda a los usuarios que actualicen. Los usuarios que no puedan actualizar pueden, durante la implementación de Open y OpenAtEnd para FS, asegurarse de usar ValidPath() para verificar el path traversal o limpiar las rutas proporcionadas por el usuario manualmente.","source":"nvd"}],"published":"2023-01-20T16:00:36.000Z","modified":"2026-09-10T03:49:51.412Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H","score":8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H","score":8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-22","CWE-434"],"affected":[{"ranges":[{"version":"< 0.2.40","status":"affected"}],"vendor":"nektos","product":"act","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.2.40"}],"ecosystem":"Go","package":"github.com/nektos/act","purl":"pkg:golang/github.com/nektos/act","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.2.40"}],"ecosystem":"Go","package":"github.com/nektos/act","purl":"pkg:golang/github.com/nektos/act","source":"go"},{"ranges":[{"status":"affected","fixed":"0.2.40"}],"vendor":"act_project","product":"act","cpe":"cpe:2.3:a:act_project:act:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nektos/act/security/advisories/GHSA-pc99-qmg4-rcff","tags":["advisory","exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/nektos/act/issues/1553","tags":["issue-tracking","report","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/nektos/act/commit/63ae215071f94569d910964bdee866d91d6e3a10","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/nektos/act/blob/master/pkg/artifacts/server.go#L65","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/nektos/act/blob/v0.2.35/pkg/artifacts/server.go#L245","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/nektos/act/blob/v0.2.35/pkg/artifacts/server.go#LL103C2-L103C2","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://securitylab.github.com/advisories/GHSL-2023-004_act/","tags":["exploit","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-22726","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/nektos/act","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nektos/act/releases/tag/v0.2.40","tags":["web"],"sources":["ghsa","go"]},{"url":"https://securitylab.github.com/advisories/GHSL-2023-004_act","tags":["advisory"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2025-03-10T21:01:07.479Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-22726","url":"https://www.cve.org/CVERecord?id=CVE-2023-22726","licence":"CVE Terms of Use","modified":"2025-03-10T21:21:14.383Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pc99-qmg4-rcff","url":"https://github.com/advisories/GHSA-pc99-qmg4-rcff","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:51.412Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2023-1504","url":"https://pkg.go.dev/vuln/GO-2023-1504","licence":"CC-BY-4.0","modified":"2026-03-03T04:51:19.300Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-22726","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-22726","licence":"Public domain","modified":"2026-06-17T05:36:02.563Z"}],"updatedAt":"2026-11-25T22:58:21.690Z","epss":{"score":0.0137,"percentile":0.72714,"date":"2026-12-01T12:00:22.000Z"}}