GHSA-ww3q-3444-q488: Out-of-bounds read via an empty signature BIT STRING in NetX Secure X.509 parsing
GHSA ID |
|
|---|---|
CVE ID |
CVE‑2026‑106464 |
Severity |
High |
CWE |
|
Published |
2026‑10‑13 |
Last updated |
2026‑10‑13 |
Affected packages
| Package | Vulnerable versions | Patched versions |
|---|---|---|
NetX Duo |
⇐ 6.5.2.202603 |
6.5.2.202603a |
Description
Summary
_nx_secure_x509_parse_signature_data computes the certificate signature’s length as tlv_length - 1 without first checking that tlv_length is non-zero. A certificate whose signature is an empty ASN.1 BIT STRING therefore parses successfully and leaves the certificate holding a signature length of 0xFFFFFFFF and a signature pointer one byte past the end of the buffer. Certificates are parsed from the peer during the TLS handshake, so the input is remote and unauthenticated.
Details
A BIT STRING carries a leading octet giving the number of padding bits, which X.509 requires to be zero for a signature. The parser accounts for that octet by advancing the data pointer one byte and subtracting one from the length, but nothing rejects a BIT STRING that has no content octet at all.
_nx_secure_x509_asn1_tlv_block_parse accepts a zero length: it enforces only that the length does not exceed the remaining buffer, which a zero length trivially satisfies. The signature length field is an unsigned 32-bit value, so the subtraction wraps.
_nx_secure_x509_certificate_verify reads the signature pointer and length straight from the certificate and passes both to the configured public-cipher method with no validation in between. Both the RSA and the ECDSA path take them from that same place. For ECDSA, _nx_crypto_ecdsa_verify validates the public key length and then dereferences the signature’s first bytes to walk its DER structure; its internal bounds checks compare against the supplied length, which the wrap has made effectively unbounded, so they do not constrain the walk.
Confirmed by parsing alone, with no cryptographic operation invoked. A well-formed test certificate parses to a signature length of 256 at offset 715 of a 971-byte buffer. The same certificate with its signature replaced by an empty BIT STRING parses with status 0 — success — to a signature length of 4294967295 at offset 713 of a 712-byte buffer.
Impact
An out-of-bounds read driven by a remote peer’s certificate, reachable before the handshake completes and therefore without authentication. The immediate consequence is a read far outside the certificate buffer during signature verification, which is expected to fault. Whether any portion of the read data is observable to the peer is not established: the verification result reaches the peer only as a handshake success or failure.
Both a TLS client validating a server certificate and a TLS server configured to request client certificates parse attacker-supplied certificates on this path.
Affected configurations
Any configuration that parses a certificate from a remote peer, which is the ordinary TLS case. The defect is in common X.509 parsing rather than behind an option.
Releases up to and including 6.5.2.202603 are affected.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N, 8.7, High.
No attack requirements are recorded: a single certificate the peer supplies is sufficient, and the wrap does not depend on a race or on memory layout. Confidentiality impact is not claimed because the read data is not shown to be observable. The reasoning worth recording is that the wrap converts a length check into a no-op rather than merely producing a wrong length, so downstream bounds logic offers no protection.
Patches
Fixed in NetX Duo 6.5.2.202603a.
_nx_secure_x509_parse_signature_data now rejects a signature BIT STRING with no content octets as an invalid certificate, so no caller can observe a wrapped length. _nx_crypto_ecdsa_verify additionally checks that it has a signature and enough of it to hold the DER sequence header, because that header is read before the checks that use the length it encodes, and the long form is read one octet further still. No public API changes, so applications need no source change.
Coverage: nx_secure_x509_parse_test gains a certificate whose signature is an empty BIT STRING and expects it to be rejected. Three cases in nx_secure_ecdsa_error_checking_test passed a zero signature length and so reached the code they name only by reading out of bounds; they now pass the length the code needs, and what each one covers is unchanged.
Workarounds
None that preserve certificate validation. Declining to parse certificates from untrusted peers is not a workaround for TLS.
Credits
Found and fixed by Frédéric Desbiens, while investigating an unrelated regression-test crash during certification work on the 6.4.1 baseline.
The analysis, the fix and the regression coverage were produced with AI assistance under human review, in accordance with the Eclipse Foundation’s Generative AI Usage Guidelines.