Skip to content

fix: F-2026-18800 | [Dual Defense] Short SVM send_funds Defaults TxType=0 While Claiming Funds → Mapped to GAS - #327

Merged
Aman035 merged 4 commits into
audit-fixesfrom
F-2026-18800
Aug 24, 2026
Merged

fix: F-2026-18800 | [Dual Defense] Short SVM send_funds Defaults TxType=0 While Claiming Funds → Mapped to GAS#327
Aman035 merged 4 commits into
audit-fixesfrom
F-2026-18800

Conversation

@Aman035

@Aman035 Aman035 commented Aug 24, 2026

Copy link
Copy Markdown
Member

decodeUniversalTxEvent accepted a truncated event, logged "defaulting to Funds", then set TxType = 0. Wire 0 is GAS, not FUNDS.

GAS credits the sender UEA via swap; FUNDS deposits PRC20 to the recipient. Same amount, different party. TxType 0 also selects FAST confirmation, so a truncated FUNDS transfer lost finality too.

  • SVM: every field through signature_data now required, truncation is an error. from_cea stays optional.
  • EVM: same hole, a log under five static words was stored with TxType left at 0. Now rejected.
  • Malformed events are discarded, not stored with empty event data.
  • Not reachable today: the gateway always emits the full 142-byte layout and forged logs were already blocked. This closes the path.

Tests: three real devnet events as fixtures, every truncation of them rejected, leniency tests inverted, constructInbound pinned so FUNDS never becomes GAS. 8 mutations, all caught.

Also here: event cleaner race. TestEventCleanerStop already failed under -race on audit-fixes. The goroutine now owns its ticker and stop channel, running/stopCh are behind a mutex, and Stop waits so shutdown cannot close the chain DB under an in-flight cleanup. 5 mutations, all caught.

@Aman035 Aman035 changed the title fix(chains): reject truncated UniversalTx events instead of defaulting tx_type to GAS fix: F-2026-18800 | [Dual Defense] Short SVM send_funds Defaults TxType=0 While Claiming Funds → Mapped to GAS Aug 24, 2026
@Aman035
Aman035 merged commit b5be6a7 into audit-fixes Aug 24, 2026
6 of 7 checks passed
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