Skip to content

fix: harden keychain iframe security boundaries#2380

Closed
Larkooo wants to merge 2 commits intomainfrom
Larkooo/lock-keychain-iframe
Closed

fix: harden keychain iframe security boundaries#2380
Larkooo wants to merge 2 commits intomainfrom
Larkooo/lock-keychain-iframe

Conversation

@Larkooo
Copy link
Contributor

@Larkooo Larkooo commented Feb 5, 2026

Summary

  • validate and pin keychain iframe child origin in controller before establishing Penpal messaging, and pass explicit childOrigin to connectToChild
  • tighten iframe policy in controller by dropping local-network-access and forcing referrerPolicy="no-referrer"
  • harden keychain Coinbase checkout iframe by requiring a safe HTTPS Coinbase URL and sandboxing the iframe to limit script/navigation capabilities
  • add focused tests for both the controller origin validator and keychain Coinbase URL sanitizer

Testing

  • Ran pnpm lint:check
  • Ran pnpm --filter @cartridge/controller exec jest src/__tests__/iframeSecurity.test.ts --runInBand
  • Ran pnpm --filter @cartridge/keychain test:ci src/utils/iframe-url.test.ts
  • Attempted pnpm --filter @cartridge/controller test --runInBand (fails on existing unrelated src/__tests__/parseChainId.test.ts invalid URL case)

@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
controller-example-next Ready Ready Preview Feb 5, 2026 11:10pm
keychain Ready Ready Preview Feb 5, 2026 11:10pm
keychain-storybook Ready Ready Preview Feb 5, 2026 11:10pm

Request Review

@claude
Copy link
Contributor

claude bot commented Feb 5, 2026


Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


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