CVE-2019-19794: Insecure generation of random numbers in github.com/miekg/dns

github.com/miekg/dns Updated 02 Oct 2025

Summary

18/05/2021
Yes i
Moderate
5.9

CVE-2019-19794: miekg/dns insecurely generates random numbers. Affects github.com/miekg/dns versions < 1.1.25. Fixed in 1.1.25. How to fix ↓

Also tracked for

The same CVE-2019-19794 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The github.com/miekg/dns package is a Go DNS package that is used in various products, including CoreDNS. It provides functionality for DNS message parsing, generation, and handling. The package is vulnerable to an insecure generation of random numbers due to the use of math/rand. This vulnerability affects versions before 1.1.25 of the package.

Vulnerability Detail

The insecure generation of random numbers in the github.com/miekg/dns package leads to predictability of the Transaction ID (TXID) used in DNS requests. This predictability allows attackers to forge responses, potentially leading to DNS cache poisoning or other types of DNS-related attacks. The vulnerability has a CVSSv3 score of 5.9, indicating a moderate severity.

How To Fix

Minimum fixed version

1.1.25

This is the first release that contains the fix.

go get github.com/miekg/dns@v1.1.25

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is necessary to update the package to the fixed version.

Conclusion

The github.com/miekg/dns package before version 1.1.25 is vulnerable to an insecure generation of random numbers, which can lead to response forgeries in DNS. It is recommended to update the package to version 1.1.25 or later to fix this vulnerability. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for github.com/miekg/dns →

Share this vulnerability

FAQ

The vulnerability allows attackers to forge DNS responses, potentially leading to DNS cache poisoning or other DNS-related attacks.

Versions before 1.1.25 of the github.com/miekg/dns package are affected.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability. The playground allows you to analyze your Gopkg.lock file without requiring any signup or installation.

Yes, the CVSSv3 score for this vulnerability is 5.9, indicating a moderate severity.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/miekg/dns.

How To Fix

Minimum fixed version

1.1.25

This is the first release that contains the fix.

go get github.com/miekg/dns@v1.1.25

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