fix(cli): harden MCP transport, file writes, auth & input from review - #12
Merged
Conversation
Address the full adversarial-review findings across the CLI. Critical - mcp --http binds 127.0.0.1 by default (was every interface), enables DNS- rebinding protection, and logs the real bind host; --host opts into a wider interface with an explicit exposure warning. - MCP text_to_speech / stream_text_to_speech confine outputPath to a relative path inside the working dir and never overwrite — no more model-driven arbitrary file write. High - logout surfaces a failed keychain delete when the key is still readable, instead of reporting a clean logout while the credential survives. - say --out - refuses a TTY on the default (non-stream) route too, not only under --stream. - readStdin bounds the first byte on a non-TTY pipe, so an idle inherited pipe (agents/CI) can't hang forever; slow producers still read to EOF untimed. Medium - Non-stream say no longer silently overwrites the default speech.<ext>; --force is accepted on both routes. - A flag/env API key no longer inherits the stored base_url/api_version. - mcp install --embed-key writes 0600, atomically, and warns about plaintext. - listVoices tolerates a null models array; adds a page ceiling. - api buildUrl preserves the base path and refuses an endpoint that resolves off the API host (protocol-relative Bearer leak). - search_docs bounds every round-trip with the shared HTTP timeout. Low / cleanup - intArg rejects hex/scientific/padded ints; renderTable neutralizes control chars in untrusted cells; PowerShell playback escapes single quotes; --json + --agent-friendly is rejected as contradictory; api --field coerces typed JSON scalars; api -d - / @file send raw bytes; remove dead apiErrorFromResponse; correct stale v3/tool-list comments.
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.
No description provided.