/

CVE-2026-44590

Severity:

CRITICAL RISK

(9.3)

Command Injection in Sherlock GitHub Actions Workflow

CVE-2026-44590

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution in CI Pipeline and Token Exfiltration

Severity:

CRITICAL RISK

(9.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A command injection vulnerability in Sherlock's GitHub Actions workflow validate_modified_targets.yml allows arbitrary shell commands to be executed on the CI runner via the pull_request_target trigger.

Any GitHub user who opens a crafted pull request against an affected repository can execute commands and exfiltrate the GITHUB_TOKEN without needing approval, review, or merge.

Affected context

This vulnerability affects repositories using Sherlock's GitHub Actions workflow validate_modified_targets.yml with the pull_request_target trigger and unsanitized use of pull request–controlled input in shell commands.

It is relevant in environments where CI runs with a privileged GITHUB_TOKEN that can write to the repository or access other sensitive resources.

The risk is highest when the workflow executes automatically for pull requests from forked repositories and when token permissions are broad.

Exploit preconditions

  • Attack surface: GitHub-hosted or self-hosted CI runners executing the validate_modified_targets.yml workflow.
  • Required access: Ability to open a pull request against the repository (any GitHub user, if the repository is public and allows forks).
  • Trigger point: The pull_request_target GitHub Actions trigger that runs workflows in the context of the base repository when a PR is opened or updated.
  • Why exploitation is possible: Workflow steps interpolate PR-controlled data into shell commands without proper quoting or sanitization, enabling command chaining or injection. Because pull_request_target runs with the base repo's GITHUB_TOKEN, injected commands can exfiltrate credentials or modify the project.

Why this happens

The core issue is the unsafe construction of shell commands inside a GitHub Actions workflow, where user-controlled values from a pull request (such as filenames, paths, or other metadata) are passed directly into a command line.

In combination with the pull_request_target trigger, this leads to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

Instead of treating untrusted input as inert data, the workflow logic allows special characters (e.g., ;, &&, |) to alter the execution flow, letting attackers append or replace intended commands.

The bug is systemic to patterns that interpolate PR content into shells or scripts without strict validation, quoting, or using safer mechanisms (like parameterized actions or dedicated inputs).

Potential impact

  • Arbitrary command execution on the CI runner during workflow execution
  • Exfiltration of the GITHUB_TOKEN and use of that token to:
  • Push malicious commits or tags
  • Open or modify pull requests and issues
  • Manipulate release artifacts or workflows
  • Tampering with build outputs and published artifacts (e.g., supply-chain compromise)
  • Lateral movement to other repositories or services accessible with the exposed token
  • Leakage of secrets or environment variables configured in the workflow or runner

General mitigation guidance

Effective mitigation focuses on hardening workflow design and reducing trust in pull request input:

  • Avoid passing untrusted PR data directly into shell commands; where shell commands are necessary, use strict quoting, input validation, or allowlists for acceptable values.
  • Prefer GitHub Actions that accept structured inputs over raw shell execution, and avoid complex inline scripts that manipulate untrusted data.
  • Use the pull_request trigger instead of pull_request_target when the workflow does not need write access to the target repository; if pull_request_target is required, carefully audit any interaction with PR-controlled data.
  • Restrict GITHUB_TOKEN permissions to the minimum necessary, disabling write scopes where not needed and avoiding broad repository or organization-level privileges.
  • Separate workflows that require high-privilege tokens from those that process external contributions, and gate sensitive workflows behind explicit approvals or manual triggers.
  • Apply a defense-in-depth approach by limiting secrets exposure in PR-triggered workflows and isolating build steps that interact with untrusted contributions.

How teams detect issues like this

Organizations can detect similar issues through:

  • Static analysis of workflow files: Scan .github/workflows/*.yml for:
  • Use of pull_request_target with write-enabled GITHUB_TOKEN
  • Shell steps (run:) that interpolate GitHub context fields (e.g., github.event.*) without quoting or validation
  • Policy enforcement: Introduce repository or organization-wide policies that:
  • Forbid pull_request_target in public repos unless explicitly justified
  • Require least-privilege token scopes and restrict secrets in PR-triggered workflows
  • Code review practices: Add security review checkpoints for new or modified workflows, focusing on how they use PR input and what permissions are granted.
  • Automated tooling: Employ CI security scanners or GitHub-specific workflow linters that flag command injection patterns, dangerous context usage, and high-risk trigger/permission combinations.

Sources

SourceLink
github.comgithub.com/sherlock-project/sherlock/security/advisories/GHSA-v6wr-ccr4-x8g9

Frequently asked

questions

Yes. Any GitHub user who can open a pull request against an affected repository can potentially exploit this issue, without needing prior access to the CI infrastructure itself.

The attacker only needs the ability to create a pull request (for public repositories, this generally means any user who can fork the repo). No maintainer approval, code review, or merge is required to trigger the vulnerable workflow.

The safest pattern is to redesign workflows to avoid executing untrusted PR data in shell commands, minimize privileges for the GITHUB_TOKEN, and, where possible, avoid pull_request_target for workflows that do not require elevated access. Structured actions and explicit validations should replace ad hoc shell logic processing user-controlled inputs.

Treat CI workflows as part of the application's attack surface: enforce security reviews for workflow changes, standardize on least-privilege token policies, use automated scanning for workflow misconfigurations, and train maintainers to avoid mixing high-privilege tokens with untrusted PR input in shell commands or scripts.

Find out what's already
exploitable in your codebase.