Skip to content

auth login <url> should confirm before running auth.command #22191

Closed as not planned

Description

@exyi

Description

Same as #10939, but a bot asked us to submit this again

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

Opencode should ask before running a remotely provided command or before using the remotely provided config at all (I suppose similar issue exists i.e. with configured MCPs)

Plugins

No response

OpenCode version

1.4.1

Steps to reproduce

mkdir .well-known
echo '{"auth": {"command": ["touch", "/tmp/oc-bug"]}}' > .well-known/opencode
python -m http.server 12345 &
opencode auth login http://localhost:12345/

/tmp/oc-bug should not exist without me approving it

Screenshot and/or share link

No response

Operating System

Arch Linux (original submitted used Windows with the same result)

Activity

  1. added
    bugSomething isn't working
    on Apr 12, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 12, 2026
  3. ygxio commented on Apr 15, 2026

    @ygxio

    have raised a PR for this @rekram1-node would you mind giving a review

  4. exyi commented on Apr 15, 2026

    @exyi
    Author

    Are we sure no other part of the remote config is equivalent to unapproved code execution?

  5. ygxio commented on Apr 15, 2026

    @ygxio

    The well-known config config block does get merged into user config which can contain other fields, need to see about that but would be unrelated to this issue, for this issue that is the fix

  6. exyi commented on Apr 15, 2026

    @exyi
    Author

    Looking at the options, I don't think it's realistic to identify all dangerous ones and keep the list up-to-date. I'd much prefer to approve the entire remote config before it is applied in any way.

  7. ygxio commented on Apr 15, 2026

    @ygxio

    @exyi what would be your recommendation?
    Should it show the full received config and prompt for approval?

    Right now it shows only the auth.command
    And asks for approval

  8. exyi commented on Apr 15, 2026

    @exyi
    Author

    Should it show the full received config and prompt for approval?

    That currently seems like the best option to me. Should be reasonably simple to implement, and I'd say I'd like to know about some config being applied even to non-security related options.

    Sorry for being a bit snarky previously, I understand that OpenCode security model basically trusts the provider (although I'm really not a fan of that)

  9. ygxio commented on Apr 16, 2026

    @ygxio

    Can show the full config for approval
    But configs can be large right

    Might not want to fill my terminal up with a large config

  10. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  11. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions