# CVE-2026-40012: PowerDNS Recursor incorrect caching of ECS zero-scoped answers

Source: https://junglewise.ai/threats/cve-2026-40012-powerdns-recursor-incorrect-caching-of-ecs-zero-scoped-answers  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-25. Updated: 2026-06-25  
License: CC BY 4.0 with a link back

CVE-2026-40012 · Severity: medium · CVSS 5.3 · Published 2026-06-25

PowerDNS Recursor, a tool used by internet service providers to look up website addresses for users, contains a flaw in how it handles specific network location data. When the EDNS Client Subnet (ECS) feature is enabled, the system incorrectly stores certain 'zero-scoped' responses in its temporary memory cache. This could allow an attacker to potentially access information that should have been restricted or handled differently, though it does not directly lead to a full system takeover.

Technologies: [Powerdns Recursor](https://junglewise.ai/threats/technologies/recursor). Vendors: [Powerdns](https://junglewise.ai/threats/vendors/powerdns).

## Quick answers

**Is CVE-2026-40012 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-40012 being exploited in the wild.

**How severe is CVE-2026-40012?** Medium severity, with a CVSS score of 5.3, published 25 June 2026.

**Which products and versions are affected?** Powerdns Recursor 5.2.0 to 5.2.10, 5.3.0 to 5.3.7, 5.4.0 to 5.4.2.

**Is there a fix for CVE-2026-40012?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-40012 attacked?** It is attacked over the network, in a hosted service.

**Am I affected by CVE-2026-40012?** Check whether you run Powerdns Recursor at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A vulnerability exists in PowerDNS Recursor's handling of EDNS Client Subnet (ECS) data within its packet cache. Specifically, the recursor incorrectly caches answers with a zero scope (indicating the answer is global and not subnet-specific) when it should not. This issue is located in the 'EDNS Client Subnet processing' module within pdns_recursor.cc. An unauthenticated remote attacker can exploit this behavior in configurations where ECS is enabled to potentially cause the recursor to serve incorrect or sensitive cached data to other clients. The issue is addressed in versions 5.2.11, 5.3.8, and 5.4.3.

## Affected products

- PowerDNS Recursor 5.2.0 to 5.2.10, 5.3.0 to 5.3.7, 5.4.0 to 5.4.2

## Timeline

- 2026-06-25: disclosed
- 2026-06-25: advisory

## References

- [https://repo.powerdns.com/](https://repo.powerdns.com/)
- [https://docs.powerdns.com/recursor/security-advisories/powerdns-advisory-powerdns-2026-08.html](https://docs.powerdns.com/recursor/security-advisories/powerdns-advisory-powerdns-2026-08.html)

## Related threats

- [PowerDNS Recursor DNSSEC wildcard validation bypass in RRSIG processing](https://junglewise.ai/threats/cve-2026-52688-powerdns-recursor-dnssec-wildcard-validation-bypass-in-rrsig)
- [PowerDNS Recursor DNSSEC validation bypass in wildcard CNAME/DNAME records](https://junglewise.ai/threats/cve-2026-52686-powerdns-recursor-dnssec-validation-bypass-in-wildcard-cname)
- [PowerDNS Recursor TTL capping bypass in NS record refresh](https://junglewise.ai/threats/cve-2026-52684-powerdns-recursor-ttl-capping-bypass-in-ns-record-refresh)
- [PowerDNS Recursor DNSSEC validation failure via EDNS spoofing](https://junglewise.ai/threats/cve-2026-52690-powerdns-recursor-dnssec-validation-failure-via-edns-spoofing)
- [PowerDNS Recursor improper ZONEMD validation in ZoneToCache](https://junglewise.ai/threats/cve-2026-42390-powerdns-recursor-improper-zonemd-validation-in-zonetocache)
