CVE-2024-38528: Ntpd Unlimited Number Of NTS-KE Connections Vulnerability

HIGH
Advisory Identifier: GHSA-2xpx-vcmq-5f72
CVSS 7.5
CWE-770
Published
Advisory Summary

CVE-2024-38528 is a HIGH (CVSS 7.5) unlimited number of nts-ke connections vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Ntpd libraries in the crates.io ecosystem. The issue involves unlimited number of nts-ke connections can crash ntpd-rs server. Remediation is available by upgrading affected packages to version 1.1.3.

CVE-2024-38528 at a Glance

CVE Identifier CVE-2024-38528
GHSA Identifier GHSA-2xpx-vcmq-5f72
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Ntpd
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/A:H).

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 None (I:N)
Availability High (A:H)

How to Fix CVE-2024-38528

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

ntpd fixed: 1.1.3
Upgrade ntpd to 1.1.3
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 ntpd

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-38528, inspect your project dependencies for Ntpd:

inspect dependencies for ntpd

Analyze the terminal output to locate any version of Ntpd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.3), 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Ntpd, 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

### Summary Missing limit for accepted NTS-KE connections allows an unauthenticated remote attacker to crash ntpd-rs when an NTS-KE server is configured. Non NTS-KE server configurations, such as the default ntpd-rs configuration, are unaffected. ### Details Operating systems have a limit for the number of open file descriptors (which includes sockets) in a single process, e.g. 1024 on Linux by default. When ntpd-rs is configured as an NTS server, it accepts TCP connections for the NTS-KE service. If the process has reached the descriptor limit and tries to accept a new TCP connection, the accept() system call will return with the EMFILE error and cause ntpd-rs to abort. A remote attacker can open a large number of parallel TCP connections to the server to trigger this crash. The connections need to be opened quickly enough to avoid the `key-exchange-timeout-ms` timeout (by default 1000 milliseconds). ### Impact Only NTS-KE server configuration are affected. Those without an NTS-KE server configuration such as NTS client only or NTP only configuration are unaffected. For affected configurations the ntpd-rs daemon can made completely unavailable by crashing the service. If ntpd-rs is automatically restarted, an attacker can repeat the attack to prevent ntpd-rs from doing anything useful. ### Workarounds - Disable NTS-KE server functionality - Increase system resource limits (`RLIMIT_NOFILE`) to make the attack more difficult - Lower the `key-exchange-timeout-ms` configuration setting to make the attack more difficult

CVE-2024-38528 Affected Ntpd Versions

1 component(s)
Fixed Versions:
1.1.3
Product / Package Ecosystem Affected Versions Fixed Version
ntpd
crates.io
≥ 0.3.1
< 1.1.3
1.1.3

References

Frequently Asked Questions

What is CVE-2024-38528?
CVE-2024-38528 is a security vulnerability in Ntpd involving Unlimited number of NTS-KE connections can crash ntpd-rs server under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Ntpd versions are affected?
Affected versions include releases prior to 1.1.3 across affected packages: ntpd.
What version fixes CVE-2024-38528?
Upgrading to 1.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ntpd affected?
Yes, ntpd is affected in releases prior to 1.1.3. Upgrade your dependency to 1.1.3 or later.
What is the CVSS score of CVE-2024-38528?
CVE-2024-38528 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-38528?
CVE-2024-38528 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check crates.io dependencies for CVE-2024-38528?
Run the dependency tree command: 'inspect dependencies for ntpd'. 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-2xpx-vcmq-5f72",
  "modified" : "2024-07-02T02:26:15Z",
  "published" : "2024-06-28T21:05:52Z",
  "aliases" : [ "CVE-2024-38528" ],
  "summary" : "Unlimited number of NTS-KE connections can crash ntpd-rs server",
  "details" : "### Summary\nMissing limit for accepted NTS-KE connections allows an unauthenticated remote attacker to crash ntpd-rs when an NTS-KE server is configured. Non NTS-KE server configurations, such as the default ntpd-rs configuration, are unaffected.\n\n### Details\nOperating systems have a limit for the number of open file descriptors (which includes sockets) in a single process, e.g. 1024 on Linux by default. When ntpd-rs is configured as an NTS server, it accepts TCP connections for the NTS-KE service. If the process has reached the descriptor limit and tries to accept a new TCP connection, the accept() system call will return with the EMFILE error and cause ntpd-rs to abort.\n\nA remote attacker can open a large number of parallel TCP connections to the server to trigger this crash. The connections need to be opened quickly enough to avoid the `key-exchange-timeout-ms` timeout (by default 1000 milliseconds).\n\n### Impact\nOnly NTS-KE server configuration are affected. Those without an NTS-KE server configuration such as NTS client only or NTP only configuration are unaffected. For affected configurations the ntpd-rs daemon can made completely unavailable by crashing the service. If ntpd-rs is automatically restarted, an attacker can repeat the attack to prevent ntpd-rs from doing anything useful.\n\n### Workarounds\n- Disable NTS-KE server functionality\n- Increase system resource limits (`RLIMIT_NOFILE`) to make the attack more difficult\n- Lower the `key-exchange-timeout-ms` configuration setting to make the attack more difficult",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "ntpd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.1"
      }, {
        "fixed" : "1.1.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.1.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pendulum-project/ntpd-rs/security/advisories/GHSA-2xpx-vcmq-5f72"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38528"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pendulum-project/ntpd-rs/commit/6049687006ea5b26eeac927964b5fcc80d7bde50"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pendulum-project/ntpd-rs"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-28T21:05:52Z",
    "nvd_published_at" : "2024-06-28T20:15:02Z"
  }
}