Trust twilio.world hosts for URL-based plugin installs - #703
Open
andrewdmaclean-work wants to merge 1 commit into
Open
Trust twilio.world hosts for URL-based plugin installs#703andrewdmaclean-work wants to merge 1 commit into
andrewdmaclean-work wants to merge 1 commit into
Conversation
Plugins installed from a git/tarball URL (rather than an npm package name) always triggered the "untrusted source" warning and confirmation prompt, because isTwilioPlugin only checked the npm package name against ALLOWED_ORGS and URL installs carry no name. Add a host allowlist (ALLOWED_HOSTS) checked against the install URL's hostname, matching an entry exactly or as a subdomain. twilio.world is a Twilio-owned developer training platform that serves a phone-verified, per-user plugin tarball, so installs from it should not warn. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dprothero
approved these changes
Aug 5, 2026
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.
What
Adds a host allowlist so plugins installed from a
twilio.worldURL don't trigger the "untrusted source" warning + confirmation prompt.Why
isTwilioPluginonly checked the npm package name againstALLOWED_ORGS. Plugins installed from a git/tarball URL carry no package name (oclif'sparsePlugin()returns{ url, type: 'repo' }with noname), soisTwilioPlugin(undefined)always returnedfalse— meaning every URL-based install unconditionally hit:TwilioWorld is a Twilio developer training platform that distributes its CLI plugin as a phone-verified, per-user tarball served from a Twilio-owned
twilio.worldhost (twilio plugins:install "https://…twilio.world/cli/plugin/{session}-{code}"). Learners shouldn't be told the official Twilio plugin is malicious.How
ALLOWED_HOSTS(['twilio.world']) checked against the install URL'shostname. A host matches if it equals an entry or is a subdomain of one (.endsWith('.twilio.world')), socli.twilio.worldis trusted buttwilio.world.evil.comandnottwilio.worldare not.isTwilioPlugin(name, url)gains a URL branch (wrapped in try/catch for malformed URLs); when a URL is present it takes precedence over the name check.plugin-installhook now passesoptions.plugin.urlthrough.Twilio owns
twilio.worldand all of its subdomains, so this is "trust our own domain" — the URL-based counterpart to the existing@twilio//@twilio-labs/npm-org allowlist.Testing
test/services/plugins.test.js— exact host, subdomain, disallowed host, substring-spoof rejection, malformed URL, and url-beats-name precedence.test/hooks/plugin-install.test.js— trusted URL suppresses the warning; untrusted URL still warns.plugins.js.Note for reviewers
This ships to all twilio-cli users via the release pipeline. Existing installs benefit after
twilio update; fresh installs pick it up automatically. This is intended as a standing entry, mirroring how the npm-org allowlist trusts Twilio-owned scopes.🤖 Generated with Claude Code