ID Mismatch Vulnerability in dnslib Package: A Security Concern

python-dnslib Updated 02 Oct 2025

Summary

10/01/2022
N/A
Yes i
Medium
5.3

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 ↓

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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

Share this vulnerability

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.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

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