Skip to content

fix: enforce record filter client-side (hosted scanner ignores the filter subobject)#59

Merged
iamalwaysuncomfortable merged 1 commit into
masterfrom
fix/scanner-client-side-filter
Jul 16, 2026
Merged

fix: enforce record filter client-side (hosted scanner ignores the filter subobject)#59
iamalwaysuncomfortable merged 1 commit into
masterfrom
fix/scanner-client-side-filter

Conversation

@iamalwaysuncomfortable

Copy link
Copy Markdown
Member

Summary

The hosted scanner ignores the filter subobject of an OwnedFilter and returns every record the account owns (verified live 2026-07-16). That meant records.find(program=..., record=...) and records.find_credits() could return records from foreign programs — callers selecting a record from the result would then build transactions against the wrong program and hit phantom commitments on chain.

Changes

  • Add enforce_record_filter() to _scanner_common.py that applies the program/record subfilter locally on scanned results.
  • Apply it in both the sync (facade/records.py) and async (facade/async_client.py) facades, in find() and the find_credits(at_least=None) path.

Tests

  • New sync + async tests feed mixed-program scanner responses and assert find(program=...), find(record=...), and find_credits() only return matching records.
  • python -m pytest python/tests/test_facade_records.py python/tests/test_facade_async.py → 57 passed.

…ilter subobject

The hosted scanner ignores the filter subobject of an OwnedFilter and
returns every record the account owns (verified live 2026-07-16), so
find(program=..., record=...) and find_credits() could return records
from foreign programs — callers would then select records from the
wrong program and hit phantom commitments on chain.

Add enforce_record_filter() to _scanner_common and apply it to the
scanner results in both the sync and async facades (find and the
find_credits at_least=None path; find_credits_records already
enforces credits-only server-side parsing). Covered by new sync and
async tests with mixed-program scanner responses.
@iamalwaysuncomfortable
iamalwaysuncomfortable merged commit 9cb3d2a into master Jul 16, 2026
6 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.

2 participants