Skip to content

fix(security): validate extensions PDA in deposit processor#21

Merged
dev-jodee merged 1 commit intomainfrom
fix/deposit-extensions-pda-validation
Feb 20, 2026
Merged

fix(security): validate extensions PDA in deposit processor#21
dev-jodee merged 1 commit intomainfrom
fix/deposit-extensions-pda-validation

Conversation

@dev-jodee
Copy link
Collaborator

Summary

  • Add validate_extensions_pda() call to the deposit processor before reading hook extensions, matching the existing validation in the withdraw processor
  • Prevents an attacker from passing an empty/system-owned account as the extensions parameter to silently bypass all configured pre- and post-deposit hooks

Details

The deposit instruction reads hook configuration from the extensions account but did not validate that it is the correct PDA ([b"extensions", escrow_key]). An attacker could pass any zero-length account (e.g., system program) as extensions, causing get_extensions_from_account to return no hooks and silently skip all pre/post-deposit hook invocations.

The withdraw processor already validates this at withdraw/processor.rs:39. All extension-writing instructions (SetHook, SetArbiter, AddTimelock, BlockTokenExtension) and AllowMint also validate the extensions PDA. Only Deposit was missing this check.

Ref: GHSA-735q-4mm8-3j4w

Test plan

  • just build succeeds
  • just integration-test — all 178 tests pass
  • Verify existing deposit+hook tests still pass (covered by suite above)
  • Verify deposit with spoofed extensions account is rejected (needs new test)

The deposit instruction reads hook configuration from the extensions
account but did not validate that it is the correct PDA. An attacker
could pass any empty account as extensions, causing hooks to be silently
skipped. Add the same validate_extensions_pda() call that the withdraw
processor already uses.

Ref: GHSA-735q-4mm8-3j4w
@dev-jodee dev-jodee force-pushed the fix/deposit-extensions-pda-validation branch from c51050b to 92de2a9 Compare February 20, 2026 17:56
@dev-jodee dev-jodee requested a review from amilz February 20, 2026 17:57
@dev-jodee dev-jodee merged commit 86204fa into main Feb 20, 2026
5 checks passed
@dev-jodee dev-jodee deleted the fix/deposit-extensions-pda-validation branch February 20, 2026 18:15
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.

2 participants