Skip to content

fix(login): initialize PacketEvents encryption wrapper and bufferLock - #4

Merged
Namnarak merged 1 commit into
mainfrom
fix/wrapper-bufferlock-prelogin-20261013
Oct 12, 2026
Merged

Namnarak merged 1 commit into
mainfrom
fix/wrapper-bufferlock-prelogin-20261013

Conversation

@Namnarak

Copy link
Copy Markdown
Contributor

Production issue

On 2026-10-13 00:42:59 +0700, after P2P v1.0.7 fixed the pre-login TemporaryPlayer -> CraftPlayer transport cast, FastLoginPlus's ProtocolLibLoginSource.enableOnlinemode() failed to send its LOGIN.SERVER.ENCRYPTION_REQUEST: NullPointerException: Cannot enter synchronized block because wrappper.bufferLock is null. FastLoginPlus then logged that it fell back to cracked login, so this is authentication-sensitive.

Root cause and fix

P2P's PacketContainer(PacketType) uses constructor-skipping ObjectAllocator to allocate PacketEvents wrappers, leaving PacketWrapper.final bufferLock and registries uninitialized. For security-sensitive WrapperLoginServerEncryptionRequest, instantiate via PacketEvents' own public constructor with shouldAuthenticate=true (FastLoginPlus also explicitly sets it); preserve client protocol version. For other newly allocated wrappers, create a genuine base PacketWrapper template and copy the runtime-invariant per-packet bufferLock and registries, preserving existing packetTypeData and PacketContainer field mapping.

Validation

  • Version 1.0.8; 24 Maven tests, no failures/errors, 1 existing skipped test, shaded JAR build passed on Java 25 locally.
  • Added regression tests showing constructor-bypassing allocation lacks the lock and initialization restores unique per-packet locks, and guard against missing template lock.
  • Does not modify FastLoginPlus, AuthMe policies or bypass Premium authentication.

Production deployment requires backup + controlled Minecraft restart and verification with real Java premium/cracked login paths. Do not claim complete fix from build success alone.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T17:59:52.336462Z 48b86f2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Namnarak
Namnarak merged commit e60fe2e into main Oct 12, 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