
Advisory and proof-of-concept for CVE-2026-112325, a remotely triggerable NULL-pointer dereference in OpenThread's mDNS DNS-SD Discovery Proxy causing Border Router DoS.
RecordCache::Matches()
A remotely triggerable NULL-pointer dereference in OpenThread's native Multicast DNS (mDNS) / DNS-SD Discovery Proxy. Two well-formed DNS-SD query packets from a node on the Thread mesh crash a default-configuration OpenThread Border Router (OTBR), taking the whole Thread network off-network — a remotely triggerable denial of service (CWE-476).
| CVE | CVE-2026-112325 |
| Advisory | GHSA-xf9m-rgrq-7vqf |
| CWE | CWE-476: NULL Pointer Dereference |
| Severity | Medium — CVSS 3.1 5.7 (AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H) |
| Component | openthread/openthread — native mDNS / DNS-SD Discovery Proxy (src/core/net/mdns.cpp) |
| Affected | all revisions prior to commit b47613f1 |
| Patched | b47613f1 (PR #13653) |
| Impact | Remote crash → DoS of the Border Router → Thread network loses off-network connectivity |
| Reporter / Fix | @j0xh-sec |
OpenThread ships its own Multicast DNS stack. Its DNS-SD Discovery Proxy keeps a cache of in-flight
record queriers (Core::RecordCache) and compares an incoming querier against each cached entry in
Core::RecordCache::Matches(). The comparison helper Core::NameMatch(const Heap::String&, const char *)
validates the cached name but never checks that the incoming querier's C-string name is non-NULL.
A NULL name is a legal, documented value ("no next labels"). The matcher handles it in one
direction but not the mirror direction: when a cached entry has non-NULL next-labels and the
incoming querier's next-labels are NULL, the code walks into NameMatch(..., nullptr), which
forwards the NULL pointer to a byte-by-byte string compare that dereferences address 0x0.
Both inputs are produced by ordinary, well-formed DNS-SD queries received over the network, so an attacker on the Thread mesh crashes the Border Router with two packets.
The faulting type ot::Dns::Multicast::Core::RecordCache is compiled only when OpenThread's native
mDNS stack is enabled (OT_MDNS), together with the DNS-SD server (OT_DNSSD_SERVER) and the
Discovery Proxy (OT_DNSSD_DISCOVERY_PROXY).
This is the default for the shipping product: ot-br-posix defaults OTBR_MDNS=openthread, which
forces all three options ON (ot-br-posix/third_party/openthread/CMakeLists.txt). So a
stock-configured OpenThread Border Router has exactly the three pieces this bug needs.
1. The unguarded helper — src/core/net/mdns.cpp:
bool Core::NameMatch(const Heap::String &aHeapString, const char *aName)
{
// aHeapString is null-checked; aName is NOT.
return !aHeapString.IsNull() &&
StringMatch(aHeapString.AsCString(), aName, kStringCaseInsensitiveMatch);
}
StringMatch() → Match() (src/core/common/string.cpp:75) then does:
while (*aPrefixString != kNullChar) { ... } // aPrefixString == nullptr → read of address 0
2. The asymmetric caller — RecordCache::Matches() in src/core/net/mdns.cpp:
if (mNextLabels.IsNull())
{
VerifyOrExit(aQuerier.mNextLabels == nullptr); // this direction is guarded
}
else
{
VerifyOrExit(NameMatch(mNextLabels, aQuerier.mNextLabels)); // mirror case: NOT guarded → crash
}
3. Where the NULL comes from — src/core/net/dnssd_server.cpp StartOrStopRecordQuerier():
querier.mFirstLabel = firstLabel;
querier.mNextLabels = (StripDomainName(nextLabels) == kErrorNone) ? nextLabels : nullptr; // ← NULL
A query whose name cannot be stripped of the proxy domain yields mNextLabels == nullptr. If a
previously cached entry carries non-NULL next-labels and the same first label, Matches() takes the
else branch and dereferences NULL.
NULL is the documented contract for this field (include/openthread/mdns.h,
include/openthread/platform/dnssd.h: "Can be NULL"), and a prior fuzzer-driven hardening pass
(PR #12184) explicitly tolerated it — only this one mirror branch was missed.
Match(char const*, char const*, StringMatchMode) common/string.cpp:75 ← SEGV, addr 0x0
Core::NameMatch(Heap::String const&, char const*) net/mdns.cpp
Core::RecordCache::Matches(RecordQuerier const&) net/mdns.cpp
LinkedList<RecordCache>::FindMatching<...> common/linked_list.hpp
Server::DiscoveryProxy::StartOrStopRecordQuerier(...) net/dnssd_server.cpp
Server::ProcessQuery(...) / HandleUdpReceive(...) net/dnssd_server.cpp
The fault is reached synchronously from HandleUdpReceive() while parsing a received DNS-SD query —
not from a background timer — so it is driven directly by attacker-supplied packets.
Ordinary DNS-SD queries. Nothing malformed.
| # | QNAME | QTYPE | Effect |
|---|---|---|---|
| 1 | default.service.arpa.default.service.arpa | 0 | StripDomainName() leaves service.arpa → cached with non-NULL mNextLabels |
| 2 | default.service.arpa | 0 | StripDomainName() fails → querier mNextLabels = nullptr → compared against #1 → SEGV |
QTYPE 0 matters: it is absent from the proxy's action table, so the action defaults to
kQueryingRecord — the branch that builds a raw RecordQuerier. Both packets share the QTYPE because
Matches() checks the record type before the names.
OPENTHREAD_CONFIG_DNSSD_SERVER_BIND_UNSPECIFIED_NETIF = 0). The attacker is therefore a device on
the Thread mesh, not an off-link / internet host — hence AV:A (Adjacent).$10 device can take the entire Thread network off-network.See poc/README.md. Two independent reproductions are provided:
poc/poc_dnssd_nullderef.cpp,
an OpenThread Nexus test that seeds the cache and delivers the two packets, crashing on every run.poc/demo.py +
poc/attacker.py: a separate attacker node joins the victim's network and sends
the two queries from its own UDP socket. Nothing is injected into the victim.Also included: poc/fuzz_dnssdp.cpp, the persistent-node DNS-SD fuzz harness
that originally surfaced the crash.