Skip to content

test: prevent recipient collision in zone fuzz test - #1426

Open
Atract0n wants to merge 1 commit into
ProjectOpenSea:mainfrom
Atract0n:fix/zone-fuzz-recipient-collision
Open

Atract0n wants to merge 1 commit into
ProjectOpenSea:mainfrom
Atract0n:fix/zone-fuzz-recipient-collision

Conversation

@Atract0n

@Atract0n Atract0n commented Nov 1, 2026 •

Copy link
Copy Markdown

test: prevent recipient collision in transfer validation zone fuzz test

Summary

Fix a false-positive failure in TestTransferValidationZoneFuzz.t.sol caused by an address collision between the authorized recipient and the recipient used for negative-path validation.

The change ensures that the test always uses a genuinely unauthorized recipient when verifying the transfer validation zone's InvalidOwner behavior.

Root Cause

The existing fuzz test uses a fixed address as an unauthorized recipient:

address strangerAddress = address(0xdeafbeef);

However, the fuzzer can generate the following valid combination:

  • offerRecipient = address(0xdeafbeef)
  • shouldSpecifyRecipient = true
  • shouldUseTransferValidationZone = true

Under these conditions, the supposedly unauthorized strangerAddress is identical to the expected recipient.

The test still calls vm.expectRevert expecting an InvalidOwner error, even though the recipient is authorized.

As a result, the transaction may legitimately proceed instead of reverting, causing the test to fail with:

DifferentialTestAssertionFailed()

The underlying failure was traced to the Foundry expectation:

next call did not revert as expected

This is an issue in the test's negative-path setup rather than evidence of incorrect Seaport protocol behavior.

Fix

The correction ensures that the unauthorized recipient cannot match the authorized recipient.

Specifically:

  1. Determine the expected recipient based on shouldSpecifyRecipient.
  2. Initialize the negative-test recipient to address(0xdeafbeef).
  3. If that address matches the expected recipient, use address(0xdeafbef0) instead.
  4. Reuse the calculated expected recipient in the existing InvalidOwner assertion.

The change preserves the intended negative-path coverage while eliminating the address collision.

Scope of changes:

  • Modified file: test/foundry/zone/TestTransferValidationZoneFuzz.t.sol
  • Files changed: 1
  • Lines added: 8
  • Lines removed: 3
  • Production contract changes: None
  • Dependency or submodule changes: None

Reproduction and Root Cause Verification

The original failure was reproduced using an isolated Foundry A/B diagnostic.

Original test:

  • Result: FAIL
  • Error: DifferentialTestAssertionFailed()
  • Underlying cause: next call did not revert as expected

Collision-corrected test:

  • Optimized implementation: PASS
  • Reference implementation: PASS

The A/B diagnostic used a Seaport test harness with seaport-core pinned to:

523097f9cee66c15d308c900c50f336b291cda08

The comparison confirmed that avoiding the recipient collision eliminated the reproduced failure.

Original Fuzz Seed

0x9626e6de1414e944426b2681d3c3c9f3db7efd26cccfeab3ddb2031480193b41

Validation on the Pull Request Branch

The updated test was subsequently validated on a clean checkout of the fork, using the dependencies and submodules associated with the repository's current main branch.

Environment:

  • Framework: Foundry
  • Solidity compiler: 0.8.24
  • Test suite: TestTransferValidationZoneOffererTest
  • Test: testFulfillAvailableAdvancedFuzz
  • Fuzz runs: 256
  • Fuzz seed: Original reproduction seed

Build results:

  • Reference profile: PASS
  • Optimized profile: PASS

Fuzz test results:

  • Tests passed: 1
  • Tests failed: 0
  • Fuzz runs completed: 256
  • Result: PASS

Foundry output:

[PASS] testFulfillAvailableAdvancedFuzz(...) (runs: 256)

Suite result: ok. 1 passed; 0 failed; 0 skipped

The previously reproduced address-collision scenario no longer causes the test to fail.

Security and Compatibility Impact

This pull request improves the reliability of the transfer validation zone fuzz test by preventing false-positive failures.

It does not modify:

  • Seaport's production smart contracts
  • Order fulfillment logic
  • Transfer validation zone implementation
  • Access control or authorization rules
  • Protocol interfaces or external behavior

This is a test correctness fix, not a demonstrated security vulnerability in Seaport.

Conclusion

The reported failure was caused by the test using an address that could also be selected as the authorized recipient.

By ensuring that the negative-test recipient is always distinct from the expected recipient, the test consistently verifies the intended InvalidOwner behavior.

The correction has been validated through deterministic A/B reproduction and 256 successful fuzz executions on the updated PR branch.

@Atract0n

Atract0n commented Nov 1, 2026

Copy link
Copy Markdown
Author

Validation completed on a clean fork checkout with Solidity 0.8.24. Both reference and optimized builds succeeded. The previously failing fuzz test passed with the original seed (256 runs, 0 failures). Only the test file was modified.

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