/

CVE-2026-27938

Severity:

HIGH RISK

(7.7)

OS Command Injection in WPGraphQL GitHub Actions Release

CVE-2026-27938

Awaiting Analysis

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution in CI/CD Environment

Severity:

HIGH RISK

(7.7)

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 the WPGraphQL GitHub Actions workflow allows arbitrary shell commands to be executed on the Actions runner when a pull request from develop to master is merged.

Because the workflow injects the pull request body directly into a run: shell block, a maliciously crafted PR description can break out of the intended command and execute attacker-controlled commands in the CI environment.

Affected context

This vulnerability affects repositories that:

  • Use the WPGraphQL release.yml GitHub Actions workflow or derive workflows from it
  • Execute pull-request–driven release workflows on GitHub-hosted or self-hosted runners
  • Incorporate ${{ github.event.pull_request.body }} (or similar user-controlled fields) directly into shell commands in run: steps

The risk materializes when a pull request from develop to master is merged and the workflow automatically executes, treating the PR body as part of a shell command.

Exploit preconditions

  • Attack surface: GitHub Actions workflow triggered on pull request merge (CI/CD pipeline).
  • Required access: Ability to open or modify a pull request from develop to master in the affected repository (e.g., contributor, compromised account, or fork-based PR if permitted).
  • Trigger point: The automatic execution of the release.yml workflow when the PR is merged, causing the PR body to be interpolated into a run: shell block.
  • Why exploitation is possible: The workflow directly interpolates untrusted, user-controlled text (github.event.pull_request.body) into a shell command line without escaping or sanitization, so shell metacharacters in the PR body are interpreted as part of the command.

Why this happens

The root cause is a classic OS command injection pattern within a CI configuration.

The GitHub Actions workflow uses an expression (${{ github.event.pull_request.body }}) inside a run: block, which is executed by a shell (typically bash).

Because the PR body is fully under an attacker's control and is not quoted or sanitized, any shell metacharacters, command separators, or subshell constructs in the body are processed by the shell.

This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where untrusted input is concatenated into shell commands, allowing attackers to influence command parsing and execution.

Potential impact

  • Execution of arbitrary commands on the GitHub Actions runner during the release workflow
  • Theft or exfiltration of repository contents, build artifacts, or workflow secrets available to that job
  • Tampering with build outputs, release artifacts, or changelogs produced by the pipeline
  • Pivoting to other resources accessible from the runner (e.g., package registries, deployment endpoints, or self-hosted infrastructure)
  • Disruption of CI/CD operations through deletion or corruption of intermediate files

General mitigation guidance

Effective mitigation focuses on breaking the direct flow from untrusted content to the shell and minimizing shell-based logic in CI:

  • Avoid embedding untrusted template expressions (like PR bodies, titles, comments) directly inside run: shell commands.
  • Prefer structured inputs and dedicated action parameters instead of free-form text for workflow configuration.
  • When shell usage is unavoidable, treat all externally influenced values as untrusted and:
  • Pass them as environment variables to scripts where they are safely handled as data.
  • Apply strict quoting and escaping, and avoid constructing command lines via string concatenation.
  • Use purpose-built GitHub Actions or scripts that process PR metadata as data, not as part of command invocations.
  • Limit the permissions and secrets available to workflows that process user-controlled data, using least privilege and fine-grained token scopes.

How teams detect issues like this

Detecting similar issues typically involves inspecting CI/CD definitions and enforcing secure patterns:

  • Static analysis and linting: Scan workflow files (e.g., .github/workflows/*.yml) for:
  • run: steps that interpolate ${{ github.* }} or ${{ env.* }} directly into shell commands.
  • Unquoted or partially quoted interpolations next to shell metacharacters.
  • Code review signals: Flag workflows that:
  • Consume PR body, title, comments, or issue text in shell commands.
  • Build command strings via concatenation instead of using arguments or environment variables.
  • Policy enforcement: Use repository policies or CI governance tools to:
  • Require security review for changes to workflow files.
  • Block patterns known to be unsafe (e.g., direct use of user-controlled GitHub context fields in run:).
  • Automated tooling: Integrate workflow-specific security scanners or general SAST tools that understand GitHub Actions syntax and can highlight command injection risks in pipeline definitions.

Sources

SourceLink
github.comgithub.com/wp-graphql/wp-graphql/commit/de0c2d590593f1099546ad517106e454a498bc58
github.comgithub.com/wp-graphql/wp-graphql/security/advisories/GHSA-4q9f-mjxf-rx7x

Frequently asked

questions

No, the vulnerability is confined to the GitHub Actions environment running the release.yml workflow. The impact is limited to what the workflow runner can access, such as repository contents, secrets configured for that job, and connected services.

Yes. The attacker needs the ability to create or modify a pull request from develop to master that will ultimately be merged and trigger the workflow. This might involve a legitimate contributor account, a compromised account, or a fork-based PR if the repository's contribution model allows it.

The safest pattern is to stop passing PR body (or similar untrusted text) directly into shell commands. Instead, treat it strictly as data—consume it through purpose-built actions or scripts that do not invoke a shell with that content, or pass it via environment variables and process it without constructing command lines from it.

Design workflows so that untrusted user input never participates in command construction. Rely on arguments, structured parameters, and well-defined APIs rather than dynamic shell concatenation. Combine this with automated checks for unsafe interpolation patterns in workflow files and require security-focused review for any changes to CI/CD definitions.

Find out what's already
exploitable in your codebase.