test(relay): adversarial multi-tenant isolation + ingest robustness battery#2281
Open
s00ly wants to merge 1 commit into
Open
test(relay): adversarial multi-tenant isolation + ingest robustness battery#2281s00ly wants to merge 1 commit into
s00ly wants to merge 1 commit into
Conversation
…attery Independent wire-level verification of the relay's core security invariant — all tenant-observable state under a URL is community-local — from two hostile communities (a/b.localhost) sharing one relay process, one Postgres, and one Redis. 8 probes, each control-armed (A must observe the planted state, so a pass can never be faked by the state simply not existing): - event-id cross-tenant oracle (CWE-200/668) - NIP-17 gift-wrap live fanout confinement (OWASP A01) - mention (#p) query fencing (CWE-668) - Blossom existence-oracle error-shape indistinguishability (CWE-200) - workflow webhook door fail-closed cross-tenant + wrong-secret 401 - POST /count bridge fencing (CWE-668) - same-coordinate addressable coexistence, each tenant-scoped - ingest-door hostile battery: 10 malformed/oversized inputs, all 4xx, zero 5xx, relay healthy afterwards (OWASP A05/A10, CWE-20) Deliberately re-probes two lanes the conformance table has stubbed (event-id cross-fetch, DM fanout) because a stub means unverified, not verified-safe. Evidence: 5x 8/8 full green runs against a local two-host deployment; one unreproduced single-probe flake (no fence breach ever observed). OPEN legs recorded in-file: git smart-HTTP pointer isolation, raw-frame WS fuzzing, /moderation/audit fixture, approval-token row (blocked on WF-08). Signed-off-by: Sooly Kobayashi <yloos@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
An independent, wire-level verification of the relay's core security invariant —
all tenant-observable state under a URL is community-local — from two hostile
communities (
a.localhost,b.localhost) sharing one relay process, onePostgres, one Redis (the hosted multi-tenant shape). Blue-team framing:
every probe verifies a control is present and correct, anchored to
OWASP Top 10:2025 / CWE.
The team's
conformance_multitenantsuite is the obligation table; thisbattery shares no helpers or assumptions with it, and deliberately re-probes
two lanes the table has
todo!()-stubbed (event-id cross-fetch, DM fanout) —a stub means unverified, not verified safe. Every probe is control-armed:
community A must observe the planted state, so a pass can never be faked by
the state simply not existing.
Probes (8)
REQ {ids}+ author scan from B)#p) query from BPOST /countbridge from Bcreated_at, 2MB content, empty shapes — all must 4xx, never 5xx, relay stays healthyEvidence
Run against a local two-host deployment (setup in the file header):
hash identically — the build is stricter than the shared-bytes option the
conformance stub allows.
flake (suspected test-side timing in the live-fanout probe; no fence
breach was observed in any run — flagging transparently rather than
rounding to 100%).
smart-HTTP pointer isolation (needs a real push fixture), raw-frame WS
fuzzing,
/moderation/audit(needs a community-admin fixture),approval-token row (blocked on WF-08 per the suite's own note).
disclosure triggered (per SECURITY.md).
cargo fmt --check+cargo clippy -p buzz-test-client --all-targets -- -D warnings: clean.Related note (no code change proposed here)
While establishing the baseline,
nip11_relay_info::nip11_is_not_a_cross_community_enumeration_oraclefails on current main: the A/B NIP-11 documents differ only in
origin(
ws://<request-host>).originechoes the caller's own host, so it cannotenumerate other tenants — arguably not an oracle, and the test's
"identical apart from
icon" invariant may be too strict. Two resolutions:allowlist
originin the test with a rationale comment (my recommendation),or relay-side normalize
originto the canonical relay URL. Happy to sendeither as a follow-up — flagging here rather than bundling into this PR.
Composes with (does not overlap) #2268 and the gate-restore fix for
define_workflowsent separately.