Skip to content

GHSA-gv9j-4w24-q7vx GO-2022-0368

Improper random number generation in github.com/coredns/coredns

Medium Go
Severity
Medium
The publisher's own rating, not a CVSS score
Exploit chance (EPSS)
—
No score published
Known exploited
No
Not in CISA's catalog
Weakness
CWE-330 Use of Insufficiently Random Values
Fix
1.6.6
Upgrade github.com/coredns/coredns to this version or later

Description

Impact

CoreDNS before 1.6.6 (using go DNS package < 1.1.25) improperly generates random numbers because math/rand is used. The TXID becomes predictable, leading to response forgeries.

Patches

The problem has been fixed in 1.6.6+.

References

For more information

Please consult our security guide for more information regarding our security process.

Affected versions

Go

PackageVulnerableFixed in
github.com/coredns/coredns
< 1.6.6
1.6.6

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

github.com/coredns/coredns Go → 1.6.6

go
go get github.com/coredns/coredns@v1.6.6 && go mod tidy

Weakness

CWE-330: Use of Insufficiently Random Values

The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.

How to prevent it
  • Architecture and Design: Use a well-vetted algorithm that is currently considered to be strong by experts in the field, and select well-tested implementations with adequate length seeds. In general, if a pseudo-random number generator is not advertised as being cryptographically secure, then it is probably a statistical PRNG and should not be used in security-sensitive contexts. Pseudo-random number generators can produce predictable numbers if the generator is known and the seed can be guessed. A 256-bit seed is a good starting point for producing a "random enough" number.
  • Implementation: Consider a PRNG that re-seeds itself as needed from high quality pseudo-random output sources, such as hardware devices.
  • Architecture and Design, Requirements: Use products or modules that conform to FIPS 140-2 [REF-267] to avoid obvious entropy problems. Consult FIPS 140-2 Annex C ("Approved Random Number Generators").

References

Timeline

  1. Published
  2. Last updated by the source
AdvisorySeverityWhy it's related
GHSA-9gm5-9rfh-m6vx
CoreDNS DoH/DoQ/gRPC bypass UPDATE rejection enforced on UDP/TCP
High Also affects github.com/coredns/coredns
GHSA-mrg3-qvqr-jw29
CoreDNS: Unauthenticated memory exhaustion in custom transports
High Also affects github.com/coredns/coredns
GHSA-74w3-63xv-x9mv
CoreDNS `k8s_external` headless AXFR can emit an empty transfer batch that panics the `transfer` plugin
Low Also affects github.com/coredns/coredns
GHSA-vp29-5652-4fw9
CoreDNS has TSIG authentication bypass on gRPC and QUIC transports
Critical Also affects github.com/coredns/coredns
GHSA-qhmp-q7xh-99rh
CoreDNS has TSIG authentication bypass on DoT, DoH, DoH3, DoQ, and gRPC
High Also affects github.com/coredns/coredns
GHSA-h8mm-c463-wjq3
CoreDNS' transfer stanza selection uses lexicographic compare (subzone ACL bypass)
High Also affects github.com/coredns/coredns
GHSA-63cw-r7xf-jmwr
CoreDNS DoH GET oversized dns= query parameter causes pre-validation CPU and memory amplification
High Also affects github.com/coredns/coredns
GHSA-2wpx-qpw2-g5h5
CoreDNS' DoQ worker pool does not bound stream backlog
High Also affects github.com/coredns/coredns
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor