ID Mismatch Vulnerability in dnslib Package: A Security Concern
Summary
CVE-2022-22846: The dnslib package through 0.9.16 for Python does not verify that the ID value in a DNS reply matches an ID value in a query. Affects python-dnslib across 2 version ranges.
< 0.9.14-1+deb11u1
< 8d33ec952f3913881cfe2a972b866cb546798a7b
Fixed in 0.9.14-1+deb11u1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The dnslib package is a Python library designed for DNS (Domain Name System) operations, allowing developers to create, parse, and manipulate DNS messages. It is widely used in applications that require DNS querying and response handling. However, the package has a critical vulnerability that arises from its failure to verify that the ID value in a DNS reply matches the ID value in a corresponding query. This oversight can lead to potential security risks, including DNS spoofing attacks.
Vulnerability Detail
The vulnerability, identified as CVE-2022-22846, originates from the dnslib package versions up to 0.9.16. It does not perform adequate validation of DNS reply ID values, which can allow an attacker to craft malicious DNS responses that could be accepted by the application. This could lead to various ramifications, including data interception, redirection to malicious sites, or denial of service. The technical aspect of this vulnerability lies in the mismatch of ID values, which is a fundamental part of DNS protocol integrity.
How To Fix
Minimum fixed version
0.9.14-1+deb11u1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade python-dnslib
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate upgrading is not feasible, consider implementing additional validation checks in your application to verify the ID values in DNS replies manually. This can help mitigate the risk until the package is updated. However, this is not a complete solution and should only be a temporary measure.
Conclusion
The dnslib package has a significant vulnerability that can lead to serious security issues if not addressed. It is crucial for developers using this package to upgrade to the latest secure versions to protect their applications from potential attacks. Utilizing tools like Vulert can help in monitoring and managing these vulnerabilities effectively.
See every vulnerability recorded for python-dnslib →
FAQ
CVE-2022-22846 is a vulnerability in the dnslib package that allows for potential DNS spoofing due to ID value mismatches in DNS replies.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The consequences include possible data interception, redirection to malicious sites, and denial of service, which can compromise application security.
Yes, upgrade to version 0.9.14-1+deb11u1 for Debian 11, and version 0.9.18-1 for Debian 12 and 13.
Vulert is a tool that monitors and alerts for open-source vulnerabilities in software using just a manifest file, like package-lock.json, without requiring code access or installation.
Related vulnerabilities
Recent vulnerabilities recorded for python-dnslib.