Removing a member from a private channel revokes nothing — read and write both continue indefinitely
High — channel membership is the platform's only access-control mechanism, and removing a member from a private channel does not enforce anything. The removed principal keeps reading the channel, including messages posted after the removal, keeps downloading its attachments, and can still publish into it. Confirmed live on a hosted deployment against ordinary members, with no elevated role, no race, and no exploit code — the removed user simply keeps using the API normally.
SECURITY.md:57-61 states the intended model:
Channel membership is the only access control mechanism. There are no separate ACL lists or capability taxonomies. If a principal (human or agent) is a member of a channel, they can read and write to it. If they are not a member, the relay rejects their requests — even if they are authenticated.
Removal is registered in the roster: after channels remove-member, the addressable NIP-29
membership record (kind:39002, keyed by the channel's d tag) no longer lists the removed pubkey.
So the write to the membership state succeeds.
Root cause: the roster update is not what the read and write paths authorize against, or the
authoritative channel_members row backing them is not removed by the same operation. The
consequence is that every request path continues to treat the removed principal as a member:
POST /querywith{"kinds":[9],"#h":["<channel>"]}returns the channel's full message history.POST /queryfor{"kinds":[39000],"#d":["<channel>"]}returns the channel's metadata.POST /eventspublishing a kind:9 withh = <channel>is accepted.GET /media/{sha}serves the channel's attachments (see the companion media finding — that route has an independent defect, but here even the event layer that advertises the hash stays readable).
This is not a cache window. Re-tested at +60 s and +240 s, access was unchanged, and a message published into the channel after the removal became visible to the removed principal — so the authorization decision is being made against state that removal never updates, not against a stale snapshot that would eventually expire.
Note this is a distinct defect from the relay-level kind:9031 session-eviction gap: that one
concerns a live WebSocket surviving a community-level removal. Here each request is an independent,
freshly signed NIP-98 HTTP request, and the removal is at channel level.
Removing someone from a private channel is the routine control for offboarding, for narrowing access after a role change, and for containing a mistake ("that shouldn't have been posted here — drop them from the channel"). None of it works.
A removed member retains, indefinitely and with no further action on their part:
- Read access to all future traffic. They see everything the channel discusses after they were removed, so the channel cannot be used to discuss the removed person, an incident involving them, or anything else the team believes is now private.
- Write access. They can post into the channel, so they can also inject content, reply in threads, and impersonate continued legitimate participation.
- Attachment access, including files uploaded after removal.
Because the roster correctly shows the removal, every UI and audit surface reports that access ended. The team has no signal that it did not. Worst case: a member removed during an investigation or a dismissal continues to read the private channel coordinating it, and can post into it.
Two identities on a hosted community: an admin (victim) and an ordinary member (attacker). All attacker requests are ordinary NIP-98-signed HTTP calls with a fresh signature each time.
- Admin creates a private channel and adds the attacker. Attacker confirms legitimate access.
- Admin runs remove member on the attacker.
- Confirm the removal registered:
POST /query [{"kinds":[39002],"#p":["<attacker pubkey>"]}]
-> channels listed: ["1faed960-…","ae56c827-…","d5a609ef-…"] # private channel absent ✓
- Attacker reads the channel anyway:
POST /query [{"kinds":[9],"#h":["20e47df5-5982-4edc-977e-c8b8619127d0"],"limit":50}]
-> 14:31:41 | no one is here and no one should see this message
14:46:17 | image 
14:48:57 | another message is sent after attacker removed <- posted AFTER removal
- Attacker writes into the channel:
POST /events {"kind":9,"tags":[["h","20e47df5-…"]],"content":"triage-write-probe"}
-> 200 {"accepted":true,"event_id":"9e14ec10cef2265e34906b7507c1fa699e0072c22f2d4d841969c44ab7ee92e5"}
The message appears in the channel in the admin's client, confirming the write is authoritative and not merely accepted-then-dropped.
- Not a cache — repeat step 4 at +60 s and +240 s: still readable, and the message count grows as the admin keeps posting.
- Make removal mutate the state the read/write paths authorize against. Removing a channel member
must delete the authoritative
channel_membersrow in the same transaction that publishes the updated kind:39002 roster — never one without the other. If the roster event is currently treated as advisory whilechannel_membersis authoritative (or vice versa), collapse the two so there is a single source of truth. - Verify the read gate consults it.
POST /query,POST /countand WSREQresolve accessible channels per request; confirm that resolution reads livechannel_membersand that no per-pubkey or per-community membership cache is serving a pre-removal answer. If a cache exists, invalidate it on the membership-mutation path (the relay already has Redis cache-invalidation plumbing for this). - Verify the write gate consults it. Ingest rejects non-members with
restricted: not a channel member; that check must resolve against the same live state, so a removed member'sPOST /eventsis refused. - Evict live subscriptions on removal, so an open WebSocket stops receiving fan-out for a channel the subscriber was just removed from — otherwise fixing the HTTP paths still leaves a socket-shaped hole.
- Revoke media alongside membership — see the companion media finding; a channel-scoped read gate
on
GET /media/{sha}is required for removal to actually contain attachments.
Regression tests. After removing a member from a private channel, assert all of the following in
one test: their POST /query on that channel returns no events; their POST /count returns 0; their
POST /events into it is rejected; their open WebSocket receives no further fan-out for it; and a
GET /media/{sha} for an attachment posted in it is refused. Add a case where the channel receives a
new message after the removal and assert the removed member cannot see it.