netcode 1.4.7: missing override and loopback callbacks are refused at setup; the simulator and address_to_string are hardened - #192
Conversation
Every version site the repo carries: project(netcode VERSION) in CMakeLists.txt, and NETCODE_VERSION_FULL and NETCODE_VERSION_PATCH in netcode.h. The release-check workflow requires all three to agree with the tag. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
READ (Alex, security seat, at c6cfe36): APPROVE — every item is one of my findings, stated accurately, and the two behaviour changes are the correct ones to flag. The mapping to my audit (security#24): the missing-callback refusal (my trivia note on half-configured overrides — now a create-time refusal with two new error codes, the right fix: name the configuration error where it is configured rather than crash on first update); the loopback callback refusal (my reading of the loopback path — release-checked now, correctly, because a missing callback there is the same class); the simulator allocation guard (the reliable.c finding's sibling in netcode's simulator — log, drop, keep the queue intact); the address_to_string buffer contract (my finding 2 exactly: the contract now stated in the header beside the constant, signature unchanged, truncation named — a consumer can now size the buffer from the header alone); the console RNG note (my deployment note, now in NOTES.md and IMPLEMENTERS.md where the ports will read it). The two things a consumer must know, both said: (1) the two new error codes 7 and 8 — appended, no existing code changes value, an integration that sets both overrides or neither sees no change; (2) none of it is reachable from unauthenticated network input, so the threat model sentence is honest. The wire format unchanged. Existing integrations relink; only a caller wanting the new constant recompiles. One note for the record, not a hold: the notes attribute to 'an outside security review' — my report also carried the two historical advisories and the verification that they are fixed, which is the context this release continues. Nothing missing from my seat. Cut 1.4.7. |
|
Fable cold read (cold child) at c6cfe36: APPROVE MEDIUM — "The overrides are called on the update path with no null check" is true of one half only — only Verified:
|
|
Opus cold read (cold child) at c6cfe36: APPROVE Consumer seat (yojimbo vendor, netcode.cs mirror). The code is right and CI is 18/18; all three findings are release-body text, editable before the tag. HIGH — "Existing integrations take this release by relinking" is false for the vendoring consumer. yojimbo vendors the source ( HIGH — "none of this is reachable from unauthenticated network input" does not hold for item 5 the way a consumer reads it. The same range adds IMPLEMENTERS.md finding 4: "Exploitability: total, on an affected build — the connect token keys are predictable". The stub is not reached by packet input, true — but its output is the key that defends against packet input, so on an MEDIUM — no consumer action named for the C# port. netcode.cs#7 is open, so Verified from my seat:
|
A missing callback is refused where it is configured, instead of being called as a null pointer.
A client or server config with
override_send_and_receiveset and eithersend_packet_overrideorreceive_packet_overrideNULL is refused:netcode_client_createandnetcode_server_create(and their_dualforms) log the reason and return NULL. This is a behaviour change, and it is the reason for two new create error codes,NETCODE_CLIENT_CREATE_ERROR_MISSING_OVERRIDE_CALLBACK(7) andNETCODE_SERVER_CREATE_ERROR_MISSING_OVERRIDE_CALLBACK(8), reported bynetcode_client_create_errorandnetcode_server_create_error. The receive override is called on the update path with no null check, so a config missing it was a crash on the first update, and a config missing only the send override dropped sends silently; both are now a configuration error the create can name. Both codes are appended; no existing create error code changes value, and an integration that sets both overrides, or neither, sees no change.netcode_client_connect_loopbackandnetcode_server_connect_loopback_clientrefuse the loopback connection, in release builds as well as debug, whensend_loopback_packet_callbackis unset, and log the reason. The loopback send path is entered only through those two functions, so it is reached only with a callback to call.The network simulator allocates a packet before it touches its ring slot. If the allocator fails, the simulator logs, drops that packet, and leaves the entry already queued in the slot intact.
netcode_address_to_stringstates its buffer contract in the public header.NETCODE_MAX_ADDRESS_STRING_LENGTHsits in netcode.h besideNETCODE_MAX_PACKET_SIZE, and the declaration carries the contract: the buffer must be at least that many bytes, the result is null terminated, and a longer address is truncated to fit rather than overflowing. The signature is unchanged, so ports that mirror it are unaffected, and a caller that includes only netcode.h can size the buffer it is required to pass.Console platforms need an RNG of their own. On
__ORBIS__and__PROSPERO__the vendored libsodium'srandombytes_sysrandom_bufhas an empty body and does not write the buffer, and netcode draws every key and nonce fromrandombytes_buf. sodium/NOTES.md and IMPLEMENTERS.md now say so, for this library and for the ports that mirror it: a console port supplies a system RNG before it ships.The wire format does not change and no function signature changes. The four code changes are not reachable from unauthenticated network input; the console RNG note is different in kind, because every connect token key is drawn from that RNG, so a console port without a system RNG has predictable keys, which is why the note is in the shipped docs. Integrations that link the library take this release by relinking; a caller that wants the new header constant recompiles against netcode.h. Integrations that vendor the source re-vendor: yojimbo vendors 1.4.5, so its hop to 1.4.7 also carries 1.4.6's slack fix, which is reachable from packet input. The C# port does not yet carry the two new create error codes (netcode.cs#7). The findings come from an outside security review.