Skip to content

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

Merged
anderdc merged 1 commit into
entrius:testfrom
JSONbored:codex/validator-swapconfirm-owner-binding
May 20, 2026
Merged

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

Conversation

@JSONbored
Copy link
Copy Markdown
Contributor

@JSONbored JSONbored commented May 19, 2026

Summary

  • Closes SwapConfirm allows reservation hijacking by a different user #107
  • require SwapConfirm source addresses to match the active reservation owner before continuing
  • preserve the upstream reservation-pin behavior while resolving the current test branch conflicts
  • add regression coverage for owner mismatch, queue safety, and the existing queued-confirm path

What changed

  • handle_swap_confirm now reads the full reservation record and compares reservation.from_addr to synapse.from_address
  • mismatched confirms return before reservation-pin resolution, proof verification, source transaction lookup, pending queue insertion, or contract voting
  • tests 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 pre-commit run --all-files
  • uv run pytest tests/test_axon_handlers.py -q
  • uv run pytest tests/test_axon_handlers.py tests/test_swap_poller.py tests/test_swap_tracker.py -q
  • uv run ruff check allways/validator/axon_handlers.py tests/test_axon_handlers.py
  • uv run pytest -q
  • GitHub Actions: pre-commit-fork passed
  • GitHub Actions: pytest passed
  • CodeRabbit review against the uncommitted formatting fix: 0 issues
  • CodeRabbit review against upstream/test: 0 issues
  • 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
Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIx conflicts

@JSONbored JSONbored force-pushed the codex/validator-swapconfirm-owner-binding branch from e8e791b to 0fe86f7 Compare May 20, 2026 20:53
@JSONbored JSONbored force-pushed the codex/validator-swapconfirm-owner-binding branch from 0fe86f7 to 2362e1c Compare May 20, 2026 20:59
@JSONbored JSONbored requested a review from anderdc May 20, 2026 21:00
@JSONbored
Copy link
Copy Markdown
Contributor Author

FIx conflicts

Fixed.

@anderdc anderdc merged commit 419ef55 into entrius:test May 20, 2026
3 checks passed
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

2 participants