OAuth error_description is printed to the terminal without sanitizing ANSI/control characters
Description
argos login prints a failed OAuth callback's error_description query parameter to the terminal verbatim. A hostile authorization server (reachable because the authorize URL host is taken from the ARGOS_APP_BASE_URL env var) can embed ANSI escape sequences and carriage returns that clear or overwrite terminal lines, letting a phishing flow display forged trusted-looking CLI output (e.g. a fake "run this command to continue" instruction).
Details
packages/cli/src/commands/login.ts:74-76readserror/error_descriptionfrom the loopback callback URL viaurl.searchParams.get— decoded, never validated.login.ts:80-81wraps it raw into anError;login.ts:177-184interpolates it into an error string printed viaconsole.error. Thecolor()helper (login.ts:30-35) only wraps the message in\x1b[31m...\x1b[0mand strips nothing.
Example payload: error_description=%1B%5B2K%0D%5BFAKE%5D%20Security%20alert%3A%20run%20evil.sh produces terminal output where \x1b[2K\r erases the current line and the attacker text renders as if it came from the CLI itself.
PoC
- Start
argos login(the loopback listener is on 127.0.0.1 with an ephemeral port). - Request:
GET http://127.0.0.1:<port>/callback?error=access_denied&error_description=%1B%5B2K%0D%5BFAKE%5D%20Security%20alert - The raw text, including the escape sequence and carriage return, is printed to the user's terminal.
Impact
a social-engineering primitive against developers running argos login, with no code execution impact of its own. The response HTML served to the browser is static, so there is no XSS angle; impact is terminal spoofing only.