Skip to content

fix(postbox): bound hand-delivery flood, gate dismantle, stop book dup - #4

Merged
k33bz merged 1 commit into
mainfrom
fix/postbox-queue-dismantle-dup
Jul 14, 2026
Merged

k33bz merged 1 commit into
mainfrom
fix/postbox-queue-dismantle-dup

Conversation

@k33bz

@k33bz k33bz commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Bound hand-delivery flood, gate dismantle, stop written-book dup

Confirmed deep-review abuse findings (gmc101 is public + offline-mode):

  • DoS — unbounded free inbox flood. The queue cap only guarded posted mail (!handDelivery), but hand delivery lands straight in the recipient's inbox — which pendingCountFor counts — for free with no cap. A self-addressed or hijacked-session hand delivery could flood any player's box without bound. The cap now covers hand delivery too; legit drops still work until the box is actually full.
  • Griefing — mailbox theft. Dismantle ran on PlayerBlockBreakEvents.AFTER for any player who broke the end rod, so anyone could destroy someone else's mailbox, harvest the rare Rainbow Mailbox head, and dump their mail. Moved to BEFORE and vetoed unless the breaker owns the box (or is a creative-mode admin — the mod's own privilege idiom).
  • Dup — written books. A held-book send did held.copy() (the whole stack) but only shrink(1) from the hand, so mailing from a stack of identical written books duplicated the rest. The mailed letter is normalized to a single book (setCount(1)).

Verified: ./gradlew build (compile + tests + spotless) green.

Draft — deep-review abuse fixes, opened for your review.

Deep-review abuse findings (gmc101 public offline-mode server):

- DoS: the queue cap only applied to posted mail (!handDelivery), but hand
  delivery lands straight in the recipient's inbox (which pendingCountFor counts)
  for free with no cap — so a self-addressed or hijacked-session hand delivery
  could flood any player's box without bound. The cap now covers hand delivery
  too (legit drops still work until the box is full).
- Griefing: mailbox dismantle ran on PlayerBlockBreakEvents.AFTER for ANY player
  who broke the end rod — letting anyone destroy someone else's mailbox, harvest
  the rare Rainbow Mailbox head, and dump their mail. Moved to BEFORE and vetoed
  unless the breaker owns the box (or is a creative-mode admin).
- Dup: a held-book send did held.copy() (whole stack) but only shrink(1) from the
  hand, so mailing from a stack of written books duplicated the rest. The mailed
  letter is now normalized to a single book (setCount(1)).

Verified: gradlew build (compile + tests + spotless) green.
@k33bz
k33bz marked this pull request as ready for review July 14, 2026 13:57
@k33bz
k33bz merged commit d067460 into main Jul 14, 2026
1 check 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.

1 participant