Skip to content

fix(extensions): add trust gate to extension fast-path#601

Open
srosenthal-dd wants to merge 3 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/pup-extension-trust-gate
Open

fix(extensions): add trust gate to extension fast-path#601
srosenthal-dd wants to merge 3 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/pup-extension-trust-gate

Conversation

@srosenthal-dd

@srosenthal-dd srosenthal-dd commented Jun 18, 2026

Copy link
Copy Markdown
Member

follow-up to #589

Summary

The extension dispatch block in main_inner exits before the central trust gate, so DD_SITE=evil.com pup <extension> silently ships DD_API_KEY, DD_APP_KEY, and DD_ACCESS_TOKEN to a non-Datadog host. Built-in commands were not affected -- they always reach the central gate.

Changes:

  • Call ensure_site_trusted in the extension fast-path, after apply_to resolves the effective site and before exec_extension injects credentials into the subprocess environment
  • Thread --trust-site through PreParsedGlobals so the flag works consistently on extension invocations (same opt-in escape hatch as built-in commands)
  • Add tests for --trust-site parsing in parse_extension_args

The extension dispatch block in main_inner exited early -- before the
central trust gate -- so DD_SITE=evil.com pup <extension> would ship
DD_API_KEY/DD_APP_KEY/DD_ACCESS_TOKEN to a non-Datadog host with no
prompt. Built-in commands were not affected because they always go
through the central gate.

Fix: call ensure_site_trusted in the extension fast-path, after
apply_to resolves the effective site, and before exec_extension injects
credentials into the subprocess environment. Also thread --trust-site
through PreParsedGlobals so the flag works correctly on extension
invocations.
@datadog-prod-us1-3

This comment has been minimized.

@srosenthal-dd srosenthal-dd marked this pull request as ready for review June 18, 2026 16:18
@srosenthal-dd srosenthal-dd requested a review from a team as a code owner June 18, 2026 16:18
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.

1 participant