Skip to content

auth login <url> should confirm before running well-known auth.command #10939

Closed

Description

@MaxMiksa

Description

opencode auth login <url> fetches <url>/.well-known/opencode and runs the returned auth.command immediately to obtain a token.

This executes a remote-provided command without an explicit confirmation step and without validating the payload shape.

Suggested fix

  • Validate the well-known payload (require non-empty auth.command: string[] and auth.env: string).
  • Show the full command and require confirmation before running it.
  • Provide an explicit bypass flag for automation (e.g. --yes).

Steps to reproduce

  1. Host a .well-known/opencode response with auth.command.
  2. Run: opencode auth login <url>.
  3. Observe the command executes immediately.

Environment

  • OS: Windows 11
  • Terminal: Windows Terminal

Activity

  1. github-actions commented on Jan 28, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. MaxMiksa commented on Jan 28, 2026

    @MaxMiksa
    ContributorAuthor

    Thanks — this is related in theme but a different (narrower) surface.

    This report is specifically about opencode auth login <url> (well-known providers) fetching <url>/.well-known/opencode and immediately executing the returned auth.command to obtain a token.

    It’s not about startup-time command execution; it’s a user-invoked login flow. The proposed change is minimal: validate the payload shape and require an explicit confirmation before running the remote-provided command (with --yes as an explicit automation bypass).

  3. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  4. tmccombs commented on Apr 3, 2026

    @tmccombs

    This seems like a pretty big security problem, is anything being done to address it?

  5. exyi commented on Apr 12, 2026

    @exyi

    Re-submitted as the stalebot requested: #22191

  6. malamama035-sudo commented on Sep 11, 2026

    @malamama035-sudo

    Description

    opencode auth login <url> fetches <url>/.well-known/opencode and runs the returned auth.command immediately to obtain a token.

    This executes a remote-provided command without an explicit confirmation step and without validating the payload shape.

    Suggested fix

    • Validate the well-known payload (require non-empty auth.command: string[] and auth.env: string).
    • Show the full command and require confirmation before running it.
    • Provide an explicit bypass flag for automation (e.g. --yes).

    Steps to reproduce

    1. Host a .well-known/opencode response with auth.command.
    2. Run: opencode auth login <url>.
    3. Observe the command executes immediately.

    Environment

    • OS: Windows 11
    • Terminal: Windows Terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions