CVE-2026-91767 is a textbook signed-subtraction-to-unsigned memchr underflow in php_openssl_matches_wildcard_name (ext/openssl/xp_ssl.c). The function computes the host-suffix length as host_len - literal_len and hands the result — an unsigned size_t — straight to memchr. A certificate such as *.AAAAAA…AAA.com presented to a client connecting to a.b wraps the subtraction to near SIZE_MAX, and the scan walks off the heap allocation. No MITM is strictly required: the attacker only needs a cert the client will parse, and verify_peer_name is on by default for openssl streams. The 'network' vector in the CVSS string is doing real work to keep this at MEDIUM.
The mechanism is a recurring bug class: signed subtraction producing a length, passed to a mem-family function with no bounds check. It has hit Go, Python, Node, and OpenSSL's own X.509 matchers in the last decade, and the C type system actively encourages it. It also tends to replicate within a file. Expect that php_openssl_match_cn, the SAN iteration loop, the IP-fallback path, and the URI-vs-CN comparison in the same file were written against the same unchecked mental model and likely carry the same shape. Treat the first patch as preliminary, not final.
Two things to watch. First, the exposure window is not the CVE-to-patch lag — it is the introduction-to-disclosure window, plausibly a decade or more of default-on, attacker-reachable code. PHP downstream packagers, LTS distributors, and embedded PHP appliances need inventorying now. Second, the fix shape is load-bearing: a <= 0 guard is a tourniquet, a clamp inherits the surrounding assumptions, and a bounded memcmp or length-checked loop actually closes the bug class. Watch whether the diff also adds a regression test for a wildcard literal longer than the subject. If it does not, the genus survives in the same file even after this CVE is closed. In your own codebases, grep for host_len -, name_len -, and prefix_len - near mem-family calls in TLS and HTTP paths. That finds siblings faster than any static analyzer.