Restrict HTTP-managed replay agent config#25
Closed
haasonsaas wants to merge 1 commit into
Closed
Conversation
Contributor
|
This was fixed in latest release. Thank you for the contribution and great find! |
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.
Summary
The legacy
/api/agentssettings endpoint accepts arbitrary JSON and writes it directly to~/.raindrop/agents.json. That legacy config is later merged into the replay-agent registry. If an entry containscwd+command,/api/replaycan flow throughensureAgentEndpointDetailed()intospawnReplayCommand(), which executesconfig.commandwithshell: true.That makes the HTTP settings surface capable of creating command-bearing replay agents, even though the Settings UI only exposes replay endpoint URLs. Combined with
/api/import-runto create a matching event name and/api/replayto trigger startup, the HTTP API can be used as a command-execution bridge.Fix
command,cwd,configPath,lastSeenPort, and any other command-capable replay metadata fromagents.jsonon both load and save.PUT /api/agents.~/.raindrop/replay-projects.json.Validation
HOMEand temp Workshop DB before the fix: HTTP-managed config + imported run + replay caused the configured command to write a marker file.missing_replay_agent, and no marker file is created.bun test tests/agent-config-security.test.tsbun test tests/bun x tsc --noEmitbun run buildbun run lint(passes with 3 existing React hook warnings in app UI files)Notes
This is independent of #24. #24 closes LAN reachability of the control plane; this PR removes an HTTP-to-shell bridge inside the control plane itself.