/

CVE-2026-73800

Severity:

HIGH RISK

(8.8)

Code Injection (CWE-94) in Gitea Reusable Workflows

CVE-2026-73800

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94, CWE-829

Impact:

Arbitrary Code Execution and Secret Exposure

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

Gitea may resolve a local reusable workflow from a fork's head commit when a trusted base-branch workflow handles a pull_request_target event. A fork author could use this behavior to run attacker-controlled workflow code with repository or organization secrets available to that event.

Gitea may resolve a local reusable workflow from a fork's head commit when a trusted base-branch workflow handles a pull_request_target event. A fork author could use this behavior to run attacker-controlled workflow code with repository or organization secrets available to that event.

Affected context

The issue occurs in Gitea-based CI workflows when a pull_request_target workflow invokes a reusable workflow stored in the repository. It becomes risky when the reusable workflow is resolved from the fork's head commit rather than trusted base-branch content, allowing untrusted fork changes to cross the intended workflow trust boundary.

The issue occurs in Gitea-based CI workflows when a pull_request_target workflow invokes a reusable workflow stored in the repository. It becomes risky when the reusable workflow is resolved from the fork's head commit rather than trusted base-branch content, allowing untrusted fork changes to cross the intended workflow trust boundary.

Exploit preconditions

  • Attack surface: Pull request automation using the pull_request_target event
  • Required access: Ability to submit or modify a fork-based pull request
  • Trigger point: Execution of a trusted workflow that references a local reusable workflow
  • Why exploitation is possible: Gitea may load the reusable workflow from the fork's head commit, allowing untrusted workflow definitions to execute in a privileged event context
  • Attack surface: Pull request automation using the pull_request_target event
  • Required access: Ability to submit or modify a fork-based pull request
  • Trigger point: Execution of a trusted workflow that references a local reusable workflow
  • Why exploitation is possible: Gitea may load the reusable workflow from the fork's head commit, allowing untrusted workflow definitions to execute in a privileged event context

Why this happens

The underlying flaw is an unsafe trust-boundary decision during reusable workflow resolution. Instead of consistently selecting workflow content from the trusted base branch, the system may use content controlled by the fork author.

This behavior maps to CWE-94: Improper Control of Generation of Code, because attacker-influenced workflow content is treated as executable automation logic. It also relates to CWE-829: Inclusion of Functionality from Untrusted Control Sphere, since a trusted workflow incorporates functionality from an untrusted fork context.

The underlying flaw is an unsafe trust-boundary decision during reusable workflow resolution. Instead of consistently selecting workflow content from the trusted base branch, the system may use content controlled by the fork author.

This behavior maps to CWE-94: Improper Control of Generation of Code, because attacker-influenced workflow content is treated as executable automation logic. It also relates to CWE-829: Inclusion of Functionality from Untrusted Control Sphere, since a trusted workflow incorporates functionality from an untrusted fork context.

Potential impact

  • Attacker-controlled code execution in CI runners
  • Exposure of repository, environment, or organization secrets
  • Modification of build artifacts or release outputs
  • Repository content tampering or data exfiltration
  • Potential lateral movement through permissions granted to the workflow
  • Attacker-controlled code execution in CI runners
  • Exposure of repository, environment, or organization secrets
  • Modification of build artifacts or release outputs
  • Repository content tampering or data exfiltration
  • Potential lateral movement through permissions granted to the workflow

General mitigation guidance

Mitigation generally focuses on preserving a strict separation between trusted base-branch automation and untrusted fork content.

Common defensive patterns include:

  • Resolve reusable workflows from explicitly trusted, immutable references
  • Avoid granting secrets or elevated permissions to workflows that process fork-controlled content
  • Use least-privilege workflow tokens and runner identities
  • Separate validation jobs from privileged deployment or release jobs
  • Require explicit review and policy checks for changes to workflow definitions
  • Treat local reusable workflows invoked by privileged pull request events as trusted code

Mitigation generally focuses on preserving a strict separation between trusted base-branch automation and untrusted fork content.

Common defensive patterns include:

  • Resolve reusable workflows from explicitly trusted, immutable references
  • Avoid granting secrets or elevated permissions to workflows that process fork-controlled content
  • Use least-privilege workflow tokens and runner identities
  • Separate validation jobs from privileged deployment or release jobs
  • Require explicit review and policy checks for changes to workflow definitions
  • Treat local reusable workflows invoked by privileged pull request events as trusted code

How teams detect issues like this

Detection approaches commonly include:

  • Static analysis for pull_request_target workflows that invoke local reusable workflows
  • Policy checks identifying reusable workflow references resolved from pull request or fork content
  • Code review rules for workflow changes that alter secret access, permissions, or runner selection
  • Audit logging for unexpected workflow revisions, secret access, and privileged runner activity
  • Automated CI policy tools that enforce trusted references and restricted permissions

Detection approaches commonly include:

  • Static analysis for pull_request_target workflows that invoke local reusable workflows
  • Policy checks identifying reusable workflow references resolved from pull request or fork content
  • Code review rules for workflow changes that alter secret access, permissions, or runner selection
  • Audit logging for unexpected workflow revisions, secret access, and privileged runner activity
  • Automated CI policy tools that enforce trusted references and restricted permissions

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-1.27.2/
github.comgithub.com/go-gitea/gitea/pull/38886
github.comgithub.com/go-gitea/gitea/pull/38897
github.comgithub.com/go-gitea/gitea/releases/tag/v1.27.2
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-r9ch-mqjm-g67v

Frequently asked

questions

Potentially. Exploitation depends on the repository using a vulnerable workflow pattern and the fork author being able to influence the referenced reusable workflow.

The attacker generally needs the ability to submit or update a fork-based pull request. Additional impact depends on the permissions, secrets, runners, and external services available to the triggered workflow.

Ensure privileged workflows resolve reusable workflow content only from trusted base-branch or immutable references, and do not expose sensitive secrets to fork-controlled code.

Enforce least privilege, review workflow changes, apply policy checks to pull request events, and maintain a clear separation between untrusted validation jobs and trusted deployment or release automation.

Potentially. Exploitation depends on the repository using a vulnerable workflow pattern and the fork author being able to influence the referenced reusable workflow.

The attacker generally needs the ability to submit or update a fork-based pull request. Additional impact depends on the permissions, secrets, runners, and external services available to the triggered workflow.

Ensure privileged workflows resolve reusable workflow content only from trusted base-branch or immutable references, and do not expose sensitive secrets to fork-controlled code.

Enforce least privilege, review workflow changes, apply policy checks to pull request events, and maintain a clear separation between untrusted validation jobs and trusted deployment or release automation.

Find out what's already
exploitable in your codebase.