CVE-2021-23386 is a medium-severity (CVSS 6.5) CWE-909 vulnerability in dns-packet. A fix is available for dns-packet — see the affected versions and patch details below.
Potential memory exposure in dns-packet
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
dns-packetnpmDescription
This affects the package dns-packet before versions 1.3.2 and 5.2.2. It creates buffers with allocUnsafe and does not always fill them before forming network packets. This can expose internal application memory over unencrypted network when querying crafted invalid domain names.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | dns-packet | ≥ 2.0.0&&< 5.2.2 | 5.2.2npm install dns-packet@5.2.2 |
| 📦npm | dns-packet | all versions | 1.3.2npm install dns-packet@1.3.2 |
Affected Products
dns-packetdns-packet_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for dns-packet, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update dns-packet to 5.2.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-23386 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2021-23386 in your dependencies?
Find it across npm, including transitive dependencies.