Skip to content

fix: require confirmation before running auth.command from well-known#22621

Open
yogesh1801 wants to merge 3 commits intoanomalyco:devfrom
yogesh1801:fix/wellknown-auth-confirm
Open

fix: require confirmation before running auth.command from well-known#22621
yogesh1801 wants to merge 3 commits intoanomalyco:devfrom
yogesh1801:fix/wellknown-auth-confirm

Conversation

@yogesh1801
Copy link
Copy Markdown

@yogesh1801 yogesh1801 commented Apr 15, 2026

Issue for this PR

Closes #22191

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR prompts user to approve or deny before running the auth command from the well-known

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

  1. Set up a local server serving a malicious .well-known/opencode:
echo '{"auth": {"command": ["touch", "/tmp/oc-bug"]}}' > /tmp/.well-known/opencode
cd /tmp && python3 -m http.server 12345 &
  1. Confirmed the vulnerability existed before the fix — running opencode auth login http://localhost:12345/ silently created /tmp/oc-bug with no prompt.
  2. After the fix, running the same command shows a confirmation prompt. Selecting No exits cleanly and /tmp/oc-bug is not created. Selecting Yes runs the command as expected.

Screenshots / recordings

image

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant