Critical Vulnerability in Python-Dnslib Package: ID Value Mismatch in DNS Replies

python-dnslib Updated 02 Oct 2025

Summary

10/01/2022
N/A
No i
High
7.5

UBUNTU-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 versions 0.9.7+hg20170303-1. No fix is published. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Python-Dnslib package is a library used for DNS protocol handling in Python applications. It provides functionalities for creating and parsing DNS messages, making it essential for applications that require DNS resolution. However, versions of this package prior to 0.9.17 are vulnerable to a critical issue where the ID value in a DNS reply does not match the ID value in the corresponding query, potentially leading to DNS spoofing attacks.

Vulnerability Detail

The vulnerability, identified as CVE-2022-22846, arises from the dnslib package failing to verify that the ID value in a DNS reply matches the ID value in the original query. This flaw can allow an attacker to spoof DNS responses, leading to potential data interception or redirection of users to malicious sites. The issue affects multiple versions of the package, with a CVSS score of 7.5 indicating a high severity level.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, users can implement additional validation checks in their DNS handling logic to ensure that the ID values match before processing DNS replies. However, this is not a substitute for updating the package.

Conclusion

The Python-Dnslib package has a critical vulnerability that can lead to serious security risks. It is essential for users to update to the latest patched version to protect their applications from potential DNS spoofing attacks. Utilizing tools like Vulert can further enhance security by providing real-time alerts for vulnerabilities.

See every vulnerability recorded for python-dnslib →

Share this vulnerability

FAQ

CVE-2022-22846 is a vulnerability in the Python-Dnslib package that allows for DNS reply spoofing due to ID value mismatches.

You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. Simply upload your manifest file like package-lock.json to check for vulnerabilities.

The risks include DNS spoofing attacks, which can lead to data interception, redirection to malicious sites, and loss of user trust.

Yes, the patched version of the Python-Dnslib package is 0.9.17 or higher. Users should update to this version to mitigate the vulnerability.

Vulert uses a manifest file to monitor and alert in real-time for open-source vulnerabilities, allowing developers to stay informed about potential risks without needing to access the code directly.

Related vulnerabilities

Recent vulnerabilities recorded for python-dnslib.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback