Repository navigation
Control: close the connection on input that isn't a request - #254
Merged
bflatastic merged 1 commit intoOct 7, 2026
Merged
Conversation
A line that is not a JSON object with a string `method` (an HTTP request line, other non-JSON text, a JSON array, invalid UTF-8, a line over 4 MiB) now gets one error reply and the connection is closed, so a browser's cross-origin fetch can't smuggle a command in its body. Connections are capped at 16. Same transport as LightCraft (storytold/lightcraft#129) and FilmCraft (storytold/filmcraft#123).
Member
|
Thank you, merged! This closes a real hole. While Before merging I reviewed every line. I ran the full Thank you for the contribution! If you haven't already, come join us on Discord: https://discord.gg/artcraft |
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.
Same bug as storytold/filmcraft#119. The control server answers a non-JSON line with an error and keeps reading. So while
--controlis open, a web page's cross-origin POST to127.0.0.1:<port>gets its JSON body run as a command.Ports LightCraft's fix (storytold/lightcraft#129):
methodgets one error reply, then the connection closes.docs/control-protocol.mddocuments the rules.Also comments the two intentional
let _ =writes, perAGENTS.md.vectorcraft-cli mcp --connectsends valid requests, so it's unaffected.Testing: new tests in
control_server.rscover the browser POST and other junk input. They failed before the fix and pass now.cargo fmt --check,cargo clippy -p vectorcraft --all-targets -- -D warnings,cargo test -p vectorcraft,cargo xtask layersandcargo xtask assetsall pass.