/

CVE-2026-42603

Severity:

HIGH RISK

(8.8)

Remote Code Execution via CI/CD Misconfiguration

CVE-2026-42603

Deferred

Vulnerability type

Category:

Remote Code Execution via CI/CD Misconfiguration

CWE:

CWE-94, CWE-95

Impact:

Remote Code Execution with Repository Write Permissions

Severity:

HIGH RISK

(8.8)

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

OWASP BLT's GitHub Actions workflow .github/workflows/pre-commit-fix.yaml used the privileged pull_request_target trigger while checking out and executing code directly from an untrusted fork.

Under these conditions, an attacker could achieve remote code execution within the CI environment and gain write permissions to the target repository.

Affected context

This vulnerability manifests in GitHub repositories using OWASP BLT prior to version 2.1.2 where:

  • The .github/workflows/pre-commit-fix.yaml workflow is present and enabled
  • The workflow is triggered by the pull_request_target event
  • The workflow checks out and executes code from the pull request's fork instead of the base repository

In this context, untrusted contributor code gains effective access to a privileged GitHub Actions token.

Exploit preconditions

  • Attack surface: GitHub Actions CI environment for repositories using the affected OWASP BLT workflow.
  • Required access: Ability to open a pull request from a fork against a repository that has the vulnerable workflow enabled.
  • Trigger point: Creation or update of a pull request that causes the pull_request_target workflow to run and execute code from the forked branch.
  • Why exploitation is possible: The workflow combines a privileged event (pull_request_target, which runs in the context of the base repository) with direct checkout and execution of attacker-controlled code from the fork, allowing that code to run with write-capable credentials.

Why this happens

At its core, the issue is a CI/CD pipeline misconfiguration that leads to arbitrary code execution, aligning with CWE-94: Improper Control of Generation of Code ('Code Injection') and related dynamic execution risks as modeled by CWE-95.

The vulnerable workflow:

  • Uses pull_request_target, which by design runs with the base repository's security context and elevated permissions.
  • Checks out the pull request's fork (untrusted code) instead of a safe, trusted reference.
  • Executes that untrusted code as part of automated checks or fixes.

This pattern effectively treats attacker-supplied repository content as trusted code, allowing it to be executed in a privileged environment, thereby enabling arbitrary commands or scripts to run with write access to the repository.

Potential impact

  • Modification or deletion of repository contents via the GitHub Actions token.
  • Creation or alteration of pull requests and branches to insert malicious code.
  • Tampering with security controls, CI workflows, or configuration files to weaken future protections.
  • Injection of supply-chain backdoors into the project's source code or release artifacts.
  • Lateral movement to other systems that trust this repository or its artifacts.

General mitigation guidance

Effective mitigation focuses on restricting what code runs with privileged CI tokens and how untrusted contributions are handled:

  • Avoid executing code from untrusted forks in workflows triggered by pull_request_target; instead, run only workflows defined in the base repository and operate on safe, base branches.
  • Prefer the pull_request event when running tests on untrusted code, combined with reduced-permission tokens or GITHUB_TOKEN defaults that disallow repository writes.
  • Separate workflows into:
  • Privileged workflows that never ingest or execute contributor code directly.
  • Unprivileged workflows that can run untrusted code but operate with minimal permissions.
  • Treat workflow configurations as security-critical code: require review from maintainers familiar with CI security patterns before changes are merged.
  • Use least-privilege principles for CI tokens, disabling write scopes where they are not strictly necessary.

How teams detect issues like this

Organizations can surface this class of issue through proactive analysis of CI configurations:

  • Static configuration review: Scan GitHub Actions workflows for pull_request_target usage combined with steps that:
  • Check out code from github.event.pull_request.head or equivalent untrusted refs.
  • Execute scripts, build systems, or tooling directly from the contributor's branch.
  • Automated policy enforcement: Implement repository-level or organizational policies that:
  • Flag workflows using pull_request_target and untrusted checkout patterns.
  • Require security review or approval when workflows are added or modified.
  • Code review cues: During manual review, look for:
  • Direct calls to actions/checkout pointing to PR heads in privileged workflows.
  • Scripts that dynamically import or execute code from the repository without origin checks.
  • Security tooling integration: Integrate CI configuration linters and SAST tools that understand GitHub Actions semantics and can identify insecure workflow patterns.

Sources

SourceLink
github.comgithub.com/OWASP-BLT/BLT/security/advisories/GHSA-cgvj-qg2h-cqfh

Frequently asked

questions

Yes. An attacker can exploit it remotely by submitting a malicious pull request from a fork to a repository that has the affected OWASP BLT workflow enabled.

Typically only the ability to create a fork and open a pull request, which is often allowed for public repositories. No prior write access to the base repository is required.

The robust fix is to ensure that privileged workflows do not execute code from untrusted forks. Use pull_request for running tests on contributor code with restricted tokens, and limit pull_request_target workflows to operating solely on trusted base branches and configuration.

Adopt a CI security standard that:

  • Treats workflow files as part of the project's security boundary.
  • Restricts use of privileged events like pull_request_target and reviews them carefully.
  • Enforces least privilege for CI tokens and separates trusted and untrusted execution paths within workflows.
Find out what's already
exploitable in your codebase.