Skip to content

fix(validator): bind swapconfirm to reservation owner#342

Open
JSONbored wants to merge 1 commit into
entrius:testfrom
JSONbored:codex/validator-swapconfirm-owner-binding
Open

fix(validator): bind swapconfirm to reservation owner#342
JSONbored wants to merge 1 commit into
entrius:testfrom
JSONbored:codex/validator-swapconfirm-owner-binding

Conversation

@JSONbored
Copy link
Copy Markdown

Summary

What changed

  • handle_swap_confirm now reads the full reservation record and compares reservation.from_addr to synapse.from_address
  • mismatched confirms return before proof verification, source transaction lookup, pending queue insertion, or contract voting
  • tests now cover missing full reservation data, mismatched source owners, no side effects on mismatch, and preservation of an existing SQLite pending row

Why

A reservation is owned by the source address recorded on-chain. Confirming with a different source address should not be allowed to consume or modify that reservation, even if the caller controls the alternate address.

Validation

  • uv run pytest tests/test_axon_handlers.py tests/test_pending_confirm_queue.py tests/test_validator_rejections.py -q
  • uv run pytest -q
  • uv run ruff check allways/validator/axon_handlers.py tests/test_axon_handlers.py
  • CodeRabbit review: 0 issues after addressing one minor message-clarity note
  • Codex Security diff scan: no reportable findings

Notes

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 19, 2026
@JSONbored JSONbored marked this pull request as ready for review May 19, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SwapConfirm allows reservation hijacking by a different user

1 participant