/

CVE-2026-24780

Severity:

HIGH RISK

(8.8)

Remote Code Execution via Improper Code Execution Control

CVE-2026-24780

Analyzed

Vulnerability type

Category:

Remote Code Execution via Improper Code Execution Control

CWE:

CWE-94, CWE-276, CWE-863

Impact:

Remote Code Execution

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

AutoGPT Platform's block execution endpoints allow disabled execution blocks to be run by UUID without honoring the disabled flag, including a special BlockInstallationBlock that can write and run arbitrary Python code on the server.

Any authenticated user who can call the block execution API may achieve remote code execution on the AutoGPT server by triggering this disabled block, especially in self-hosted deployments where user self-signup is enabled.

Affected context

This vulnerability affects AutoGPT Platform deployments prior to autogpt-platform-beta-v0.6.44 that expose the block execution functionality through:

  • The main web API, and/or
  • The external BlockExecution API used by agents or integrations.

The issue arises when:

  • Blocks can be invoked directly by UUID, and
  • The platform does not enforce the disabled flag at execution time, and
  • The BlockInstallationBlock is present on the server.

The risk is higher in default self-hosted setups where:

  • Supabase signup is enabled, allowing attackers to self-register accounts, and
  • The application server has permission to write to its filesystem and import generated Python modules.

Exploit preconditions

  • Attack surface: HTTP(S) endpoints for block execution (main web API and external API).
  • Required access: Any authenticated AutoGPT Platform account capable of invoking block execution by UUID; in many self-hosted defaults, an attacker can create such an account via open signup.
  • Trigger point: A crafted call to the block execution endpoint specifying the UUID of the disabled BlockInstallationBlock.
  • Why exploitation is possible:
  • The API accepts block UUIDs and attempts to execute them regardless of their disabled status.
  • The BlockInstallationBlock is designed to write Python code to the filesystem and load it using __import__().
  • There are insufficient authorization and state checks to prevent execution of this disabled, highly powerful block.

Why this happens

At its core, this is an improper control of code generation and execution (CWE-94) issue:

  • A privileged block (BlockInstallationBlock) is capable of writing arbitrary Python code to disk and executing it dynamically via __import__().
  • The system's execution layer allows blocks to be invoked purely by UUID without robust validation of whether a block is currently allowed to run.
  • The disabled flag is not enforced by the block execution endpoints, so disabled, high-risk blocks remain reachable.

This behavior is amplified by insufficient authorization (CWE-863) and insecure default permissions (CWE-276):

  • Any authenticated user, not just administrators or block maintainers, can execute the disabled installation block.
  • Typical deployment permissions allow the application to write to and execute from the server filesystem, turning a logical authorization flaw into full remote code execution.

Abstractly, the pattern is:

  • Expose an internal "installer" or "bootstrap" primitive through a public or semi-public API.
  • Fail to enforce state/authorization checks (such as "disabled", "internal-only", or role constraints) at the point of use.
  • Allow the primitive to generate and run code using dynamic execution mechanisms like imports or eval.

Potential impact

  • Remote execution of arbitrary Python code on the AutoGPT Platform server.
  • Reading, modifying, or deleting sensitive application data and configuration.
  • Implanting persistent backdoors or malicious agents within the platform environment.
  • Lateral movement to other internal systems accessible from the AutoGPT server.
  • Abuse of the platform's compute resources for unauthorized purposes (e.g., cryptomining).
  • Full compromise of other users' workflows, agents, and stored secrets within the same deployment.

General mitigation guidance

Effective mitigation focuses on hardening execution control, reducing code execution capabilities, and tightening authorization:

  • Enforce block state:
  • Ensure the disabled (or equivalent) flag is enforced in all execution paths, including internal and external APIs.
  • Treat "installation" or "system" blocks as internal-only primitives that cannot be triggered by untrusted callers.
  • Constrain dynamic execution:
  • Avoid blocks that generate arbitrary code and then load it with mechanisms like __import__() or eval.
  • Prefer declarative, data-driven extension models over runtime code generation where possible.
  • Strengthen authorization:
  • Restrict access to powerful blocks to specific, tightly scoped roles (e.g., administrators or operators) rather than all authenticated users.
  • Apply least-privilege principles to block execution capabilities and API keys.
  • Harden runtime environment:
  • Run the AutoGPT Platform with filesystem and OS-level permissions that limit where it can write and execute code.
  • Consider process isolation, sandboxing, or containers to constrain the blast radius of any execution block.
  • Improve configuration defaults:
  • Disable self-service signup if not strictly required, or gate it behind manual approval.
  • Default high-risk functionality (installer blocks, dynamic code loaders) to off, requiring explicit opt-in by administrators.

How teams detect issues like this

Detection can combine code-level analysis, configuration review, and runtime monitoring:

  • Static analysis and code review:
  • Flag any logic that:
  • Executes blocks or plugins by identifier without verifying their state (disabled, internal, system-only).
  • Writes files and then immediately imports or executes them dynamically.
  • Look for direct or indirect use of dynamic code execution constructs (__import__, importlib, exec, eval) in block logic, especially in blocks reachable from authenticated APIs.
  • Check that RBAC or role checks are enforced at the API boundary for privileged blocks.
  • Policy and configuration checks:
  • Periodically review block definitions and ensure disabled blocks truly cannot be invoked via the API.
  • Audit role and permission mappings to ensure only trusted roles can trigger installer or system blocks.
  • Verify that self-signup and default roles do not grant access to powerful execution primitives.
  • Runtime monitoring:
  • Log and monitor block execution requests, including which block UUIDs are called and by which user or API key.
  • Alert on execution of installation or system blocks, especially from non-administrative accounts.
  • Monitor for anomalous filesystem writes and module imports originating from the application process.
  • Automated tools:
  • Incorporate SAST/IAST tools that can detect dangerous dynamic execution patterns and missing authorization checks around them.
  • Use configuration scanners or CI checks to enforce policies like "disabled blocks must not be executable" or "installer blocks are internal-only."

Sources

SourceLink
github.comgithub.com/Significant-Gravitas/AutoGPT/blob/master/autogpt_platform/backend/backend/api/external/v1/routes.py#L79-L93
github.comgithub.com/Significant-Gravitas/AutoGPT/blob/master/autogpt_platform/backend/backend/api/features/v1.py#L1408-L1424
github.comgithub.com/Significant-Gravitas/AutoGPT/blob/master/autogpt_platform/backend/backend/api/features/v1.py#L355-L395
github.comgithub.com/Significant-Gravitas/AutoGPT/blob/master/autogpt_platform/backend/backend/blocks/block.py#L15-L78
github.comgithub.com/Significant-Gravitas/AutoGPT/blob/master/autogpt_platform/backend/backend/data/block.py#L459
github.comgithub.com/Significant-Gravitas/AutoGPT/security/advisories/GHSA-r277-3xc5-c79v

Frequently asked

questions

Yes, if the AutoGPT Platform's block execution APIs are exposed over the network and an attacker can obtain an authenticated account, they can exploit this vulnerability remotely to execute code on the server.

No. The described behavior allows any authenticated user to execute the disabled BlockInstallationBlock, which is enough to achieve remote code execution. In default self-hosted setups with open signup, an attacker can often create such an account themselves.

The safest pattern is to strictly enforce block states and authorization at the API boundary and to eliminate or heavily restrict blocks that generate and execute arbitrary code. High-privilege blocks should be internal-only, require explicit administrative roles, and avoid dynamic code execution where possible.

Design agent and plugin systems such that extensions are declarative and sandboxed, apply least-privilege and role-based access control to all powerful operations, and enforce "disabled" or "internal-only" flags consistently across all invocation paths. During development, treat any dynamic code generation or execution as a high-risk pattern that requires additional review, testing, and defense-in-depth controls.

Find out what's already
exploitable in your codebase.