GHSA-vxmw-7h4f-hqxh: Pypa/gh action pypi publish PyPI Publish GitHub Action Vulnerable Vulnerability

LOW
CVSS 0.0
CWE-77
Published
Advisory Summary

GHSA-vxmw-7h4f-hqxh is a LOW (CVSS 0.0) pypi publish github action vulnerable vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Pypa/gh action pypi publish libraries in the GitHub Actions ecosystem. The issue involves pypi publish github action vulnerable to injectable expression expansions in action steps. Remediation is available by upgrading affected packages to version 1.13.0.

GHSA-vxmw-7h4f-hqxh at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vxmw-7h4f-hqxh
Severity LOW
CVSS v3.1 Base Score 0.0
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product Pypa/gh action pypi publish
Package Ecosystem GitHub Actions
Published Date
Last Updated

Security Impact

CVSS: 0.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-vxmw-7h4f-hqxh

To remediate this vulnerability, upgrade all affected Pypa/gh action pypi publish dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pypa/gh-action-pypi-publish fixed: 1.13.0
Upgrade pypa/gh-action-pypi-publish to 1.13.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for pypa/gh-action-pypi-publish

How to Check if You Are Affected

To determine whether your application is affected by GHSA-vxmw-7h4f-hqxh, inspect your project dependencies for Pypa/gh action pypi publish:

inspect dependencies for pypa/gh-action-pypi-publish

Analyze the terminal output to locate any version of Pypa/gh action pypi publish in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.13.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In Pypa/gh action pypi publish, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary `gh-action-pypi-publish` makes use of GitHub Actions expression expansions (i.e. `${{ ... }}`) in contexts that are potentially attacker controllable. Depending on the trigger used to invoke `gh-action-pypi-publish`, this may allow an attacker to execute arbitrary code within the context of a workflow step that invokes `gh-action-pypi-publish`. ### Details `gh-action-pypi-publish` contains a composite action step, `set-repo-and-ref`, that makes use of expression expansions: ```yaml - name: Set repo and ref from which to run Docker container action id: set-repo-and-ref run: | # Set repo and ref from which to run Docker container action # to handle cases in which `github.action_` context is not set # https://github.com/actions/runner/issues/2473 REF=${{ env.ACTION_REF || env.PR_REF || github.ref_name }} REPO=${{ env.ACTION_REPO || env.PR_REPO || github.repository }} REPO_ID=${{ env.PR_REPO_ID || github.repository_id }} echo "ref=$REF" >>"$GITHUB_OUTPUT" echo "repo=$REPO" >>"$GITHUB_OUTPUT" echo "repo-id=$REPO_ID" >>"$GITHUB_OUTPUT" shell: bash env: ACTION_REF: ${{ github.action_ref }} ACTION_REPO: ${{ github.action_repository }} PR_REF: ${{ github.event.pull_request.head.ref }} PR_REPO: ${{ github.event.pull_request.head.repo.full_name }} PR_REPO_ID: ${{ github.event.pull_request.base.repo.id }} ``` Permalink: https://github.com/pypa/gh-action-pypi-publish/blob/db8f07d3871a0a180efa06b95d467625c19d5d5f/action.yml#L114-L125 In normal intended operation, these expansions are used to establish a correct priority for outputs like `ref` and `repo-id`. However, these expansions have a side effect: because they're done with `${{ ... }}` and not with `${...}` (i.e. normal shell interpolation), they can *bypass normal shell quoting rules*. In particular, if both `env.ACTION_REF` and `env.PR_REF` evaluate to empty strings, then the expression falls back to `github.ref_name`, which can be an attacker controlled string via a branch or tag name. For example, if the attacker is able to set a branch name to something like `innocent;cat${IFS}/etc/passwd`, then the `REF` line may expand as: ```bash REF=innocent;cat${IFS}/etc/passwd ``` which would set `REF` to `innocent` and then run the attacker's code. Additional information about dangerous expansions can be found in [zizmor's `template-injection` rule documentation](https://woodruffw.github.io/zizmor/audits/#template-injection). ### Impact The impact of this vulnerability is very low: the expression in question is unlikely to be evaluated in normal operation, since `env.ACTION_REF` should always take precedence. In particular, the action is **not** vulnerable in many popular configurations, i.e. those where `pull_request` or `release` or a `push: tags` event is used to call the action.

GHSA-vxmw-7h4f-hqxh Affected Pypa/gh action pypi publish Versions

1 component(s)
Fixed Versions:
1.13.0
Product / Package Ecosystem Affected Versions Fixed Version
pypa/gh-action-pypi-publish
GitHub Actions
< 1.13.0
1.13.0

References

Frequently Asked Questions

What is GHSA-vxmw-7h4f-hqxh?
GHSA-vxmw-7h4f-hqxh is a security vulnerability in Pypa/gh action pypi publish involving PyPI publish GitHub Action vulnerable to injectable expression expansions in action steps under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which Pypa/gh action pypi publish versions are affected?
Affected versions include releases prior to 1.13.0 across affected packages: pypa/gh-action-pypi-publish.
What version fixes GHSA-vxmw-7h4f-hqxh?
Upgrading to 1.13.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pypa/gh-action-pypi-publish affected?
Yes, pypa/gh-action-pypi-publish is affected in releases prior to 1.13.0. Upgrade your dependency to 1.13.0 or later.
What is the CVSS score of GHSA-vxmw-7h4f-hqxh?
GHSA-vxmw-7h4f-hqxh has a CVSS v3.1 base score of 0.0 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N.
What CWE is associated with GHSA-vxmw-7h4f-hqxh?
GHSA-vxmw-7h4f-hqxh is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.).
How can I check GitHub Actions dependencies for GHSA-vxmw-7h4f-hqxh?
Run the dependency tree command: 'inspect dependencies for pypa/gh-action-pypi-publish'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vxmw-7h4f-hqxh",
  "modified" : "2025-09-04T14:07:03Z",
  "published" : "2025-09-04T14:07:03Z",
  "aliases" : [ ],
  "summary" : "PyPI publish GitHub Action vulnerable to injectable expression expansions in action steps",
  "details" : "### Summary\n\n`gh-action-pypi-publish` makes use of GitHub Actions expression expansions (i.e. `${{ ... }}`) in contexts that are potentially attacker controllable. Depending on the trigger used to invoke `gh-action-pypi-publish`, this may allow an attacker to execute arbitrary code within the context of a workflow step that invokes `gh-action-pypi-publish`.\n\n### Details\n\n`gh-action-pypi-publish` contains a composite action step, `set-repo-and-ref`, that makes use of expression expansions:\n\n```yaml\n  - name: Set repo and ref from which to run Docker container action\n    id: set-repo-and-ref\n    run: |\n      # Set repo and ref from which to run Docker container action\n      # to handle cases in which `github.action_` context is not set\n      # https://github.com/actions/runner/issues/2473\n      REF=${{ env.ACTION_REF || env.PR_REF || github.ref_name }}\n      REPO=${{ env.ACTION_REPO || env.PR_REPO || github.repository }}\n      REPO_ID=${{ env.PR_REPO_ID || github.repository_id }}\n      echo \"ref=$REF\" >>\"$GITHUB_OUTPUT\"\n      echo \"repo=$REPO\" >>\"$GITHUB_OUTPUT\"\n      echo \"repo-id=$REPO_ID\" >>\"$GITHUB_OUTPUT\"\n    shell: bash\n    env:\n      ACTION_REF: ${{ github.action_ref }}\n      ACTION_REPO: ${{ github.action_repository }}\n      PR_REF: ${{ github.event.pull_request.head.ref }}\n      PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}\n      PR_REPO_ID: ${{ github.event.pull_request.base.repo.id }}\n```\n\nPermalink: https://github.com/pypa/gh-action-pypi-publish/blob/db8f07d3871a0a180efa06b95d467625c19d5d5f/action.yml#L114-L125\n\nIn normal intended operation, these expansions are used to establish a correct priority for outputs like `ref` and `repo-id`. \n\nHowever, these expansions have a side effect: because they're done with `${{ ... }}` and not with `${...}` (i.e. normal shell interpolation), they can *bypass normal shell quoting rules*. In particular, if both `env.ACTION_REF` and `env.PR_REF` evaluate to empty strings, then the expression falls back to `github.ref_name`, which can be an attacker controlled string via a branch or tag name. \n\nFor example, if the attacker is able to set a branch name to something like `innocent;cat${IFS}/etc/passwd`, then the `REF` line may expand as:\n\n```bash\nREF=innocent;cat${IFS}/etc/passwd\n```\n\nwhich would set `REF` to `innocent` and then run the attacker's code.\n\nAdditional information about dangerous expansions can be found in [zizmor's `template-injection` rule documentation](https://woodruffw.github.io/zizmor/audits/#template-injection).\n\n### Impact\n\nThe impact of this vulnerability is very low: the expression in question is unlikely to be evaluated in normal operation, since `env.ACTION_REF` should always take precedence.\n\nIn particular, the action is **not** vulnerable in many popular configurations, i.e. those where `pull_request` or `release` or a `push: tags` event is used to call the action.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "GitHub Actions",
      "name" : "pypa/gh-action-pypi-publish"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.13.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pypa/gh-action-pypi-publish/security/advisories/GHSA-vxmw-7h4f-hqxh"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/gh-action-pypi-publish/commit/77db1b7cf7dcea2e403bb4350516284282740dd6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pypa/gh-action-pypi-publish"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-04T14:07:03Z",
    "nvd_published_at" : null
  }
}