Skip to content

docs: add 1 KB padding limit to Auth.padding and Welcome.padding#49

Open
VasilevNStas wants to merge 1 commit into
APN-Network:masterfrom
VasilevNStas:18-docs/padding-size-limit
Open

docs: add 1 KB padding limit to Auth.padding and Welcome.padding#49
VasilevNStas wants to merge 1 commit into
APN-Network:masterfrom
VasilevNStas:18-docs/padding-size-limit

Conversation

@VasilevNStas

Copy link
Copy Markdown
Contributor

Description

Documents a maximum size of 1024 bytes for both Auth.padding and Welcome.padding. No wire changes.

Problem

Auth.padding (field 6) had no stated upper bound, making proto3's default 64 MB message size ceiling the de-facto limit. Since the Node must deserialise the full Auth message before it can verify the HMAC (field 3), an unauthenticated peer could force a 64 MB pre-HMAC allocation per attempt. Welcome.padding had the same unbounded bytes type.

Changes

  • Auth.padding: "MUST NOT exceed 1024 bytes. The Node SHOULD enforce this ceiling as a raw-wire length check before deserialising the message, so that an unauthenticated peer cannot force a large pre-HMAC allocation."
  • Welcome.padding: "MUST NOT exceed 1024 bytes."

Migration

Nodes should add a raw-wire length check on the incoming Auth frame before protobuf deserialisation, rejecting any frame whose padding exceeds 1024 bytes. The exact limit can be tuned without a proto change since this is an implementation contract, not a wire format change.

Closes #18

@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@davvd @yegor256 please review

@davvd

davvd commented Jul 4, 2026

Copy link
Copy Markdown
Member

@VasilevNStas we have merge conflicts here, please resolve them and we'll merge

@VasilevNStas
VasilevNStas force-pushed the 18-docs/padding-size-limit branch from 748a27d to fac3b85 Compare July 4, 2026 17:56
@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@davvd conflicts resolved — rebased on latest master, welcome.proto changes were already covered by #50 so I took upstream version.

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.

Auth.padding has no maximum-size contract, enabling pre-auth memory allocation at the Node

2 participants