Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 GitHub Actions
Not in CISA KEV

GHSA-hw6r-g8gj-2987 //github.com/pytorch/pyto…

GHSA-hw6r-g8gj-2987 is a security vulnerability in https://github.com/pytorch/pytorch/.github/actions/filter-test-configs. No vendor fix is recorded yet; mitigation options are listed below.

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

Published
Aug 30, 2023
Updated
Aug 30, 2023
Affected
1 pkg
Patched
None yet
Exploits
None indexed
Exploitation data as of Aug 30, 2023 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected
📦https://github.com/pytorch/pytorch/.github/actions/filter-test-configs

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects GitHub Actions packages — download data is not available via public APIs for these ecosystems.

Description

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

Impact

This issue may lead to stealing workflow secrets.

Remediation

  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"

Resources

Affected Packages

1 total
EcosystemPackageVulnerable rangeFix
📦GitHub Actionshttps://github.com/pytorch/pytorch/.github/actions/filter-test-configsall versionsNo fix

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for https://github.com/pytorch/pytorch/.github/actions/filter-test-configs, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Remediation status

    No patched version of https://github.com/pytorch/pytorch/.github/actions/filter-test-configs has shipped for GHSA-hw6r-g8gj-2987 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.

  3. Mitigate without a patch

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-hw6r-g8gj-2987 can be triaged on real exposure rather than presence alone.

Tailored to GHSA-hw6r-g8gj-2987. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

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`](https://github.com/pytorch/pytorch/blob/ec26947c586dd323d741da80008403664c533f65/.github/actions/filter-test-configs/action.yml) workflow is using the raw `github.event.workflow_run.head_branch` value inside the `filter` step: ```yaml - name: Select all requested test configurations shell: bash env: GITHUB_TOKEN: ${{ inputs.github-token }} JOB
O3 Security · Impact-Aware SCA

Is GHSA-hw6r-g8gj-2987 in your dependencies?

O3 Security finds GHSA-hw6r-g8gj-2987 across GitHub Actions dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-hw6r-g8gj-2987: //github | O3 Security