/

CVE-2026-56250

Severity:

HIGH RISK

(7.5)

Missing Authorization (CWE-862) in Capgo R2 Bundles

CVE-2026-56250

Deferred

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Denial of Service and Data Deletion

Severity:

HIGH RISK

(7.5)

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

Capgo before version 12.128.2 allows upload-scoped API keys to modify the mutable app_versions.r2_path field via PostgREST, effectively retargeting app versions to arbitrary R2 bundle objects.

By abusing this missing authorization check, an attacker can point versions at victim bundles and trigger cleanup logic that deletes those objects, leading to denial of service and disruption of bundle availability.

Affected context

This vulnerability occurs in Capgo deployments where PostgREST exposes the app_versions resource to upload-scoped API keys and treats r2_path as a mutable field.

It is relevant when cleanup or lifecycle functions (such as on_version_update) operate on the R2 objects referenced by r2_path without strictly validating ownership, scope, or authorization.

Environments that rely on R2 bundle paths as the authoritative reference for application versions are particularly affected, since misdirected paths can cause destructive actions against unrelated bundles.

Exploit preconditions

  • Attack surface: PostgREST API endpoints handling app_versions updates and lifecycle events.
  • Required access: Possession of an upload-scoped API key or equivalent credentials with permission to patch app_versions.r2_path.
  • Trigger point: Updating r2_path to point at a victim's R2 bundle and then invoking actions that cause on_version_update or similar cleanup logic to run.
  • Why exploitation is possible: The API does not enforce sufficient authorization or ownership checks on which R2 objects an upload-scoped key may reference, allowing cross-tenant or cross-owner bundle targeting and subsequent deletion.

Why this happens

The underlying issue is a missing authorization control on a sensitive reference field (app_versions.r2_path) that governs access to external R2 bundle objects.

Instead of treating r2_path as a protected, ownership-validated field, the system allows upload-scoped keys to arbitrarily change it, and downstream cleanup logic trusts the new value as legitimate.

This maps to CWE-862: Missing Authorization, where the application fails to verify whether the caller is allowed to perform a specific action or affect a specific resource, enabling destructive operations on bundles belonging to other parties.

Potential impact

  • Attackers may delete victim R2 bundle objects by misdirecting cleanup routines.
  • Application versions can be pointed to incorrect or malicious bundles, causing functional disruption.
  • Service operators may experience denial of service due to missing or unavailable bundles.
  • Integrity of deployment artifacts can be compromised by unauthorized retargeting of bundle paths.

General mitigation guidance

Effective mitigation focuses on enforcing strict authorization and ownership validation around resource-linking fields and lifecycle operations.

Common patterns include:

  • Treating fields that reference external storage objects (such as r2_path) as privileged metadata, only modifiable by trusted, higher-scope roles.
  • Implementing server-side authorization rules that ensure any referenced bundle belongs to the same tenant, application, or owner as the version being updated.
  • Separating upload capabilities from resource lifecycle management so that upload-scoped keys cannot trigger destructive cleanup actions.
  • Designing cleanup and on_version_update logic to verify resource ownership and scope before performing deletions or destructive state transitions.

How teams detect issues like this

Organizations can detect similar authorization gaps by:

  • Reviewing API schemas and PostgREST configurations for fields that reference external resources and verifying that they are not writable by low-privilege roles.
  • Applying static and configuration analysis to identify missing row-level security, ownership checks, or policy constraints on mutation endpoints.
  • Instrumenting audit logging for changes to sensitive reference fields (e.g., r2_path) and monitoring for cross-tenant or unusual retargeting behavior.
  • Using automated policy enforcement tools or database-level RLS (Row-Level Security) to ensure that lifecycle routines operate only on resources associated with the authenticated principal.

Sources

SourceLink
github.comgithub.com/Cap-go/capgo/security/advisories/GHSA-pw8p-5jg6-cxj3
vulncheck.comvulncheck.com/advisories/capgo-arbitrary-r2-object-deletion-via-mutable-r2-path-in-app-versions

Frequently asked

questions

Exploitation is scoped to actors who possess upload-scoped API keys or similar credentials, but within that scope they can target any accessible R2 bundle objects referenced by r2_path, potentially impacting other tenants or applications.

An attacker must have an upload-scoped API key or account that can update app_versions.r2_path via PostgREST and invoke version lifecycle operations that cause cleanup logic to run.

Restrict modifications to sensitive reference fields to trusted roles, enforce strict ownership and tenant checks on any referenced bundle, and ensure that cleanup routines verify authorization before deleting external objects.

Model access control centrally, classify resource-linking and deletion-capable fields as high-risk, apply row-level and object-level authorization checks, and continuously review API schemas and policies for missing constraints as part of security design and code review processes.

Find out what's already
exploitable in your codebase.