protocol0 0.1 e6aeb8 GitHub Get started

Threat model

This page is a draft and may change.

Who could attack a group, and what stops them

This page lists the people and machines that could try to harm a group on protocol0. For each one it names what they could try and which rule or test answers it. It ends with the attacks that stay open, which no rule of protocol0 can stop.

The rules are P1 to P18 in the protocol. The tests are 1 to 15 and R1 to R5 in the attack tests. Anyone can run every test on a computer with the command pnpm attack.

How to read this page

Every member's computer holds a full copy of the group's record. Each copy checks every entry by itself, against the same 18 rules. A copy gives no effect to an entry that breaks a rule, whoever wrote it. So an attack has to fool every copy, and every copy runs the same checks.

1. A member

A member is 1 person on the member list, with 1 key on each of their computers.

What a member could try What answers it
A member changes an old entry in their own copy and offers that copy to the others. Each entry carries a fingerprint, so the change shows. Every other copy refuses it (P1, test 2).
A member writes a rule change with 1 signature and marks it as decided. A change needs more than half of the members. Every copy refuses it (P4, P5, test 3).
A member signs 2 versions of the same proposal on 2 branches of the record. Every copy keeps both entries as proof and counts that member once at most (P6, test 7).
A member tries to take back a signature after a decision reached its number. No entry can take a signature back, and the decision stands (P6, test 12).
A member sets the clock of a computer a year ahead to freeze open proposals. A copy holds an entry dated more than 10 minutes ahead until that time comes (P1, test R1).
A member writes a second first entry, or a post that builds on nothing. Every copy refuses both entries (P1, test R5).
A paused member keeps posting during the pause. Every copy refuses the posts until the pause ends or the group undoes it (P10, test 14).
A member opens a rival list of moderators while another list is already open. The first list to reach its number takes effect, and the other closes as replaced (P8, test 15).

2. A group of members

Some attacks need several members who act together.

What they could try What answers it
2 of 5 members go silent to block the group. The other 3 are more than half, so they carry on and decide (P4, test 1).
A team decides something that the rest of the group does not want. The group hears an objection, and the objection undoes the team's decision (P7, test 10).
A team hears an objection to a decision of the whole group. Only the group hears objections to its own decisions, so every copy refuses it (P7, test R3).
A team changes who is in the team. Only the group changes who is in a team, so every copy refuses it (P8, test R3).
1 group in a community admits new people into another group to take over its count. A group admits members only to itself, so every copy refuses it (P9, test R2).
A few members of a community try to decide for all the groups. A community decision needs more than half of the groups, each by more than half of its members (P9, test 13).

3. A removed member

A decision of the group can remove a member from the member list.

What a removed member could try What answers it
The removed member signs a new entry after the removal. Every copy refuses entries signed with that member's keys from the removal on (P14, test 8).
The removed member tries to read what the group writes after the removal. The removal carries a new group key, and the old keys cannot open later entries (P16, test 8).

4. A guest

A guest joins with a one-time code and can read and post, but never signs.

What a guest could try What answers it
A guest who was let in lets in another guest. Only a member can let a guest in, so every copy refuses it (P13, test R4).
A guest signs a proposal or writes a proposal. A guest's signature never counts, and a guest's proposal is refused (P5, P13, test R4).
A guest writes a 21st post within 1 day. Every copy refuses posts beyond 20 a day from 1 guest (P13, test R4).
A guest uses the same invite code a second time. A second join with the same code is refused (P13).

5. The helper

The helper is an AI with its own key, and its signature never counts. In this version it runs fixed rules and calls no AI model.

What the helper could try What answers it
The helper asks for a page that no decision opened to it. It receives sealed bytes that it cannot open, because it holds no key for that page (P15, P16, test 5).
The helper signs a proposal as if it were a member. Every copy refuses the signature, and the count does not move (P15, test 6).
The helper writes a change to the member list. Every copy refuses it, because that is not on its list of powers (P15, test 6).

6. A relay

A relay is a small server that passes entries between computers, and it holds no key.

What a relay could try What answers it
A relay tries to read the entries that it passes on. The content is sealed, so the relay sees bytes it cannot open (P16).
A relay changes an entry or makes a new one. The fingerprint and the signature no longer match, so every copy refuses it (P1, P17).
A relay goes silent, or drops every second entry. The copies use the next relay on the list and still reach the same state (P17, test 9).
The relay of the maker of the app shuts down. A member runs the relay program on their own computer, and the group carries on (P17, test 11).

7. The maker of the app

The maker of Pubstad has the powers of 1 ordinary member in each group the maker joins.

What the maker could try What answers it
The maker sends an order with a special "maker key". No such kind of entry exists, and no copy takes an order from the maker (P3, test 4).
The maker runs a changed app that skips the count. Every other copy checks every entry by itself and refuses the result (P18, test 4).
The maker tries to cancel an objection that the group decided. Every copy refuses the maker's entry (P7, test 10).
The maker ships an app update that moves a group to a new version of the rules. An update of the app never changes the version of protocol0 that a group runs. Only a decision of the group does (P18).

8. Someone with a stolen computer

The key of a member sits on the computer, sealed by the key store of the system.

What a thief could try What answers it
The thief opens Pubstad on the stolen computer and signs as that member. The member counts once, however many keys sign (P2). The group can replace the lost key by a decision on the member list (P14).
The thief reads the 24 recovery words on the screen You. Pubstad shows the words only inside the app, on a computer that is already open. The group can still replace the key (P14).

9. Someone on the network

This could be a person on the same wifi, or a company that carries the traffic.

What they could try What answers it
They read the traffic between a computer and a relay. They see the same sealed bytes as the relay, and they cannot open them (P16).
They change entries on the way to or from a relay. The fingerprint and the signature no longer match, so every copy refuses the entry (P1).
They block the traffic to 1 relay of the group. The copies use the next relay on the list (P17, test 9).
They read an invite code in an email and use it first. The code makes them a guest and nothing more. A guest posts only after a member lets them in, and becomes a member only by a decision (P13).

10. What stays open

These limits come from part 3 of the protocol. No test can close them, so the page states them.

  • More than half of the members can decide anything, including something bad for the others.
  • 1 person can hold 2 memberships with 2 keys, under 2 names or under 1.
  • Every member can see who signed what, because signatures are part of the record.
  • A member can set the clock of a computer back. That touches end dates and the limit of 20 posts a day for a guest.
  • Someone who saw a post can keep its words with a screenshot after the group hides it.
  • In a community of 5 groups of 5, 9 of the 25 people can decide for everyone.
  • What a group should do about unlawful content is still an open question.
  • A relay sees how many entries a group writes, when it writes them, and which public keys wrote them.
  • A relay may keep the sealed bytes of a post after the group hid it, though it cannot read them.
  • A member who signs 2 versions on 2 branches and also sets the clock back can move which version counts. Every copy still lists both entries as proof against that member.
  • A copy whose clock runs fast takes in a future entry sooner than the others. The copies agree again once every clock passes that time.

The app adds a few limits of its own.

  • A thief with an open computer can sign as its owner until the group replaces the key.
  • A removed member keeps everything that the group wrote before the removal.
  • The maker could ship an app that leaks the keys of the people who install it. The rules of protocol0 cannot stop that, because the app holds the keys of its user. The open code and the attack tests make it easier to catch, and signed builds will help once they exist.
  • A changed app on 1 computer can show its own user something false. The other copies still refuse every entry that breaks a rule.

11. What a second outside review found

A second reviewer, who had seen none of the work, tried 5 new attacks on protocol0 and read the app and the relay. Every attack broke at first. Each one is now a test that passes (see docs/TESTS.md).

  • A member who changes their app could remove someone without a new group key. Now the next remaining member who writes makes a new key, so the removed member reads nothing written later.
  • A member could take back a signature by leaving "in the past" on an older branch. Now only what builds on the leave counts as written after it.
  • A removed member could sign "in the past" on an older branch. Now an entry of a removed member counts only if the removal builds on it.
  • In a community, a small group could remove a member of another group. Now a group decides only about its own members.
  • A stranger who found an old link code could take it over. Now the use that the group built on wins.
  • A relay could guess an invite code and join as a guest. Now an invite code holds 140 bits of chance, so guessing it from the mailbox name is out of reach, and a guest who waits reads no words of the group until a member lets the guest in.
  • The app could send a request to an address in the footer of a pasted email, or to a path chosen by a constitution. Now it reads only the addresses that follow the code, and it uses only their scheme, host and port.
  • A stranger could fill the box of a group on a relay with junk, or skip a write limit with a forged header. Now junk fills its own share of the box, and the limit counts the real sender.

What stays open from that review is listed in part 3 of docs/PROTOCOL.md: a forged entry shaped like a real one can still fill 1 relay, and a stranger who reads an invite can still wait as a guest. Guessing a code is out of reach, because a code holds 140 bits of chance.

How to report a problem

If you find a way around a rule, please write to the maker first, as the security page explains.