Conversation
POST /v1/action, /facts, /documents, and /memory/search were left off the require_control list, so an anonymous caller could approve a parked run or inject tenant memory. Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Session 16 — graded ✅Score: +100. HITL actions and memory writes bypassed the control plane, so state-changing operations were reachable without the credential every neighbouring route required. First to file (2026-08-13 16:44). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks
require_controlalready guards subscriptions, events, runs, and resume. Four other write paths were left off that list:POST /v1/action— HITL approve / reject / rerun of a parked nodePOST /v1/agent/facts— inject a fact into tenant memoryPOST /v1/agent/documents— index a document into tenant memoryPOST /v1/agent/memory/search— recall across a tenant chosen in the JSON bodytests/test_control_plane_auth.pyonly enumerated the first four. An anonymous caller on the agent port could approve a waiting run or write memory asPrincipal("gateway","gateway"). The control token on the other routes does not help if these stay open.Reproduction
On current
main, both of these fail (they return 200 / 404 instead of 503 / 401):Without the test: unset
S16_CONTROL_TOKENandPOST /v1/agent/factswith any tenant. Before this change the fact is stored. After it, the route answers 503 until a token is configured, then 401 for the wrong bearer.Fix
Add
dependencies=[Depends(require_control)]on those four routes. ExtendWRITE_PATHSso the fail-closed and wrong-token cases cover them.uv run pytest tests/test_control_plane_auth.py tests/test_runtime.pypasses (24). Runtime tests already send the control token via theapp_clientfixture.