Repository navigation
harden(security): sanitize the mailbox label at the SNBT sink - #3
Merged
Merged
Conversation
Defense-in-depth: escapeSnbtString now drops control characters and legacy section-sign (U+00A7) formatting codes in addition to escaping backslash/quote, so a mailbox owner name is safe in the op-level `summon text_display` label regardless of whether upstream username validation blocks those characters (a login-validation regression, an alternate name path, or offline-mode spoofing must not turn this into a live injection). Same rationale as the sanctuary sink hardening. Verified: gradlew build green on main.
k33bz
marked this pull request as ready for review
July 14, 2026 13:57
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.
Sanitize the mailbox label at the SNBT sink (defense-in-depth)
escapeSnbtString(the only user string reaching postbox's op-levelsummon text_display) escaped"and\but passed control characters and legacy section-sign (§) codes through. Those can't be in a username today, but the escaper shouldn't depend on upstream validation staying correct — an alternate name path, a display-name mod, or offline-mode spoofing would each make it a live injection with nothing to catch it.Now it drops control chars +
§and escapes\/", robust to any input. Mirrors the sanctuary sink hardening; grieflog/ropes already do this.Verified:
./gradlew buildgreen on main.Draft — defense-in-depth hardening, opened for your review.