CVE-2024-0874: Github.com/coredns/coredns CoreDNS May Return Invalid Cache Vulnerability

MODERATE
Advisory Identifier: GHSA-m9w6-wp3h-vq8g
CVSS 5.3
CWE-524
Published
Advisory Summary

CVE-2024-0874 is a MODERATE (CVSS 5.3) coredns may return invalid cache vulnerability (CWE-524: Use of Cache Containing Sensitive Information) affecting Github.com/coredns/coredns libraries in the Go ecosystem. The issue involves coredns may return invalid cache entries. Remediation is available by upgrading affected packages to version 1.11.2.

CVE-2024-0874 at a Glance

CVE Identifier CVE-2024-0874
GHSA Identifier GHSA-m9w6-wp3h-vq8g
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-524: Use of Cache Containing Sensitive Information
Affected Product Github.com/coredns/coredns
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-0874

To remediate this vulnerability, upgrade all affected Github.com/coredns/coredns dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/coredns/coredns fixed: 1.11.2
Upgrade github.com/coredns/coredns to 1.11.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/coredns/coredns

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-0874, inspect your project dependencies for Github.com/coredns/coredns:

inspect dependencies for github.com/coredns/coredns

Analyze the terminal output to locate any version of Github.com/coredns/coredns in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.11.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-524: Use of Cache Containing Sensitive Information, where the code uses a cache that contains sensitive information, but the cache can be read by an actor outside of the intended control sphere. In Github.com/coredns/coredns, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A flaw was found in coredns. This issue could lead to invalid cache entries returning due to incorrectly implemented caching.

CVE-2024-0874 Affected Github.com/coredns/coredns Versions

1 component(s)
Fixed Versions:
1.11.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/coredns/coredns
Go
< 1.11.2
1.11.2

References

Frequently Asked Questions

What is CVE-2024-0874?
CVE-2024-0874 is a security vulnerability in Github.com/coredns/coredns involving CoreDNS may return invalid cache entries under CWE-524: Use of Cache Containing Sensitive Information.
Which Github.com/coredns/coredns versions are affected?
Affected versions include releases prior to 1.11.2 across affected packages: github.com/coredns/coredns.
What version fixes CVE-2024-0874?
Upgrading to 1.11.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/coredns/coredns affected?
Yes, github.com/coredns/coredns is affected in releases prior to 1.11.2. Upgrade your dependency to 1.11.2 or later.
What is the CVSS score of CVE-2024-0874?
CVE-2024-0874 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2024-0874?
CVE-2024-0874 is classified under CWE-524: Use of Cache Containing Sensitive Information (The code uses a cache that contains sensitive information, but the cache can be read by an actor outside of the intended control sphere.).
How can I check Go dependencies for CVE-2024-0874?
Run the dependency tree command: 'inspect dependencies for github.com/coredns/coredns'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m9w6-wp3h-vq8g",
  "modified" : "2024-09-12T00:31:22Z",
  "published" : "2024-04-25T18:30:39Z",
  "aliases" : [ "CVE-2024-0874" ],
  "summary" : " CoreDNS may return invalid cache entries",
  "details" : "A flaw was found in coredns. This issue could lead to invalid cache entries returning due to incorrectly implemented caching.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/coredns/coredns"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.11.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.11.1"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-0874"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/coredns/coredns/issues/6186"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/coredns/coredns/pull/6354"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/coredns/coredns/commit/997c7f953962d47c242273f0e41398fdfb5b0151"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:0041"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:4850"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:6009"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:6406"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2024-0874"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2219234"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/coredns/coredns"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-524" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-25T19:57:51Z",
    "nvd_published_at" : "2024-04-25T17:15:47Z"
  }
}