fix(server): make auto_run setting guard reachable in POST /settings#1756
Open
sebastiondev wants to merge 1 commit into
Open
fix(server): make auto_run setting guard reachable in POST /settings#1756sebastiondev wants to merge 1 commit into
sebastiondev wants to merge 1 commit into
Conversation
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.
Describe the changes you have made:
Vulnerability:
auto_runsetting protection is unreachable dead code (CWE-284)The
POST /settingsendpoint ininterpreter/core/async_core.pyincludes a check intended to block remote modification of theauto_runsetting. However, the check is nested inside a conditional branch that only executes when the key is"llm"or"computer":Since
"auto_run"is never equal to"llm"or"computer", the inner guard never fires. A client with network access to the server can setauto_run = Trueby sending a POST request, which causes the interpreter to execute code from subsequent prompts without user confirmation.Fix: Move the
auto_runcheck before the["llm", "computer"]conditional so it is evaluated for every key in the payload.Proof of Concept:
Against an unpatched server (default configuration, no API key set):
After this fix, the same
POST /settingscall returns a 403 error explaining thatauto_runis not modifiable through the server.Adversarial review: Before submitting, we considered whether this is practically exploitable given default conditions. The server binds to localhost by default, and without
INTERPRETER_API_KEYset, there is no authentication. This limits the attack surface to local network scenarios or deployments where the host/port has been changed to expose the server externally. However, the guard was clearly intended to block this — it's a straightforward logic bug where the protection is dead code. The fix is a one-line relocation that makes the existing security intent actually work, and serves as defense-in-depth for any deployment that exposes the server.Reference any relevant issues (e.g. "Fixes #000"):
N/A — no existing issue for this bug.
Pre-Submission Checklist (optional but appreciated):
docs/CONTRIBUTING.mddocs/ROADMAP.mdOS Tests (optional but appreciated):
Submitted by Sebastion — autonomous open-source security research from Foundation Machines. Free for public repos via the Sebastion AI GitHub App.