From 062fe1aa709217136b896c8b950e0f04435afb32 Mon Sep 17 00:00:00 2001 From: Otto Date: Wed, 11 Feb 2026 03:28:19 +0000 Subject: [PATCH] fix(security): enforce disabled flag on blocks in graph validation (#12059) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Blocks marked `disabled=True` (like BlockInstallationBlock) were not being checked during graph validation, allowing them to be used via direct API calls despite being hidden from the UI. This adds a security check in `_validate_graph_get_errors()` to reject any graph containing disabled blocks. ## Security Advisory GHSA-4crw-9p35-9x54 ## Linear SECRT-1927 ## Changes - Added `block.disabled` check in graph validation (6 lines) ## Testing - Graphs with disabled blocks → rejected with clear error message - Graphs with valid blocks → unchanged behavior

Greptile Overview

Greptile Summary

Adds critical security validation to prevent execution of disabled blocks (like `BlockInstallationBlock`) via direct API calls. The fix validates that `block.disabled` is `False` during graph validation in `_validate_graph_get_errors()` on line 747-750, ensuring disabled blocks are rejected before graph creation or execution. This closes a vulnerability where blocks marked disabled in the UI could still be used through API endpoints.

Confidence Score: 5/5

- This PR is safe to merge and addresses a critical security vulnerability - The fix is minimal (6 lines), correctly placed in the validation flow, includes clear security context (GHSA reference), and follows existing validation patterns. The check is positioned after block existence validation and before input validation, ensuring disabled blocks are caught early in both graph creation and execution paths. - No files require special attention
--------- Co-authored-by: Nicholas Tindle Co-authored-by: Claude Opus 4.6 --- autogpt_platform/backend/backend/data/graph.py | 5 +++++ autogpt_platform/backend/backend/executor/manager.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/autogpt_platform/backend/backend/data/graph.py b/autogpt_platform/backend/backend/data/graph.py index 0dc3eea887..2433a5d270 100644 --- a/autogpt_platform/backend/backend/data/graph.py +++ b/autogpt_platform/backend/backend/data/graph.py @@ -743,6 +743,11 @@ class GraphModel(Graph, GraphMeta): # For invalid blocks, we still raise immediately as this is a structural issue raise ValueError(f"Invalid block {node.block_id} for node #{node.id}") + if block.disabled: + raise ValueError( + f"Block {node.block_id} is disabled and cannot be used in graphs" + ) + node_input_mask = ( nodes_input_masks.get(node.id, {}) if nodes_input_masks else {} ) diff --git a/autogpt_platform/backend/backend/executor/manager.py b/autogpt_platform/backend/backend/executor/manager.py index 8362dae828..7304653811 100644 --- a/autogpt_platform/backend/backend/executor/manager.py +++ b/autogpt_platform/backend/backend/executor/manager.py @@ -213,6 +213,9 @@ async def execute_node( block_name=node_block.name, ) + if node_block.disabled: + raise ValueError(f"Block {node_block.id} is disabled and cannot be executed") + # Sanity check: validate the execution input. input_data, error = validate_exec(node, data.inputs, resolve_input=False) if input_data is None: