---
id: CVE-2023-30590
title: >-
  The generateKeys() API function returned from crypto.createDiffieHellman()
  only generates missing (or outdated) keys, that is, it only generates a
  private key if none has been set yet, but the function is also needed to
  compute the corre…
summary: >-
  The generateKeys() API function returned from crypto.createDiffieHellman()
  only generates missing (or outdated) keys, that is, it only generates a
  private key if none has been set yet, but the function is also needed to
  compute the corre…
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'
vendor: nodejs
product: node.js
affected:
  - 'node.js >= 16.0.0, < 16.20.1'
  - 'node.js >= 18.0.0, < 18.16.1'
  - 'node.js >= 20.0.0, < 20.3.1'
patched:
  - node.js 20.3.1
published: '2023-11-28'
updated: '2026-10-08'
sourceUpdated: '2026-10-08T22:17:24.300'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2023-30590'
references:
  - url: 'https://lists.debian.org/debian-lts-announce/2024/03/msg00029.html'
    label: support@hackerone.com
  - url: 'https://nodejs.org/en/blog/vulnerability/june-2023-security-releases'
    label: support@hackerone.com
  - url: 'https://lists.debian.org/debian-lts-announce/2024/03/msg00029.html'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://lists.debian.org/debian-lts-announce/2024/09/msg00029.html'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://nodejs.org/en/blog/vulnerability/june-2023-security-releases'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://security.netapp.com/advisory/ntap-20241101-0011/'
    label: af854a3a-2127-422b-91ae-364da2661108
tags:
  - nvd
epss: 0.01462
epssPercentile: 0.72808
ingestedAt: '2026-10-08T23:16:47.354Z'
---

## Overview

The generateKeys() API function returned from crypto.createDiffieHellman() only generates missing (or outdated) keys, that is, it only generates a private key if none has been set yet, but the function is also needed to compute the corresponding public key after calling setPrivateKey(). However, the documentation says this API call: "Generates private and public Diffie-Hellman key values".

The documented behavior is very different from the actual behavior, and this difference could easily lead to security issues in applications that use these APIs as the DiffieHellman may be used as the basis for application-level security, implications are consequently broad.

## Affected

- `node.js >= 16.0.0, < 16.20.1`
- `node.js >= 18.0.0, < 18.16.1`
- `node.js >= 20.0.0, < 20.3.1`

## Remediation

Upgrade past the affected range:

- `node.js 20.3.1`
