GHSA-HW6R-G8GJ-2987

GHSA-HW6R-G8GJ-2987 is a medium-severity security vulnerability in https://github.com/pytorch/pytorch/.github/actions/filter-test-configs (actions), affecting versions < 2.0.1. No fixed version is listed yet.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Actions expression injection in filter-test-configs (GHSL-2023-181)

The pytorch/pytorch filter-test-configs workflow is vulnerable to an expression injection in Actions, allowing an attacker to potentially leak secrets and alter the repository using the workflow.

Details

The filter-test-configs workflow is using the raw github.event.workflow_run.head_branch value inside the filter step:

- name: Select all requested test configurations
  shell: bash
  env:
    GITHUB_TOKEN: ${{ inputs.github-token }}
    JOB_NAME: ${{ steps.get-job-name.outputs.job-name }}
  id: filter
  run: |
    ...
    python3 "${GITHUB_ACTION_PATH}/../../scripts/filter_test_configs.py" \
      ...
      --branch "${{ github.event.workflow_run.head_branch }}"

In the event of a repository using filter-test-configs in a pull_request_target-triggered workflow, an attacker could use a malicious branch name to gain command execution in the step and potentially leak secrets.

name: Example

on: pull_request_target

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - name: Filter
        uses: pytorch/pytorch/.github/actions/filter-test-configs@v2

Resources

Impact

This issue may lead to stealing workflow secrets.

Affected versions

https://github.com/pytorch/pytorch/.github/actions/filter-test-configs (< 2.0.1)

Security releases

Not available

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.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

  1. Use an intermediate environment variable for potentially attacker-controlled values such as github.event.workflow_run.head_branch:
- name: Select all requested test configurations
  shell: bash
  env:
    GITHUB_TOKEN: ${{ inputs.github-token }}
    JOB_NAME: ${{ steps.get-job-name.outputs.job-name }}
    HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
  id: filter
  run: |
    ...
    python3 "${GITHUB_ACTION_PATH}/../../scripts/filter_test_configs.py" \
      ...
      --branch "$HEAD_BRANCH"

Frequently Asked Questions

  1. What is GHSA-HW6R-G8GJ-2987? GHSA-HW6R-G8GJ-2987 is a medium-severity security vulnerability in https://github.com/pytorch/pytorch/.github/actions/filter-test-configs (actions), affecting versions < 2.0.1. No fixed version is listed yet.
  2. Which versions of https://github.com/pytorch/pytorch/.github/actions/filter-test-configs are affected by GHSA-HW6R-G8GJ-2987? https://github.com/pytorch/pytorch/.github/actions/filter-test-configs (actions) versions < 2.0.1 is affected.
  3. Is there a fix for GHSA-HW6R-G8GJ-2987? No fixed version is listed for GHSA-HW6R-G8GJ-2987 yet. Monitor the advisory for updates and apply mitigations in the interim.
  4. Is GHSA-HW6R-G8GJ-2987 exploitable, and should I be worried? Whether GHSA-HW6R-G8GJ-2987 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
  5. What actually determines whether GHSA-HW6R-G8GJ-2987 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.

Stop the waste.
Protect your environment with Kodem.