CVE-2026-58040·Node.js vulnerability
An incomplete fix has been identified in Node.js: HTTPS Agent TLS session reuse skips hostname verification across identity policies (incomplete fix of CVE-2026-48934). This vulnerability affects Node.js **22.x**, **24.x**, and **26.x**.
- Severity
- high
- Software
- Node.js
- Fixed in
- 18.20.4+dfsg-1~deb12u3
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.28% — higher than 19% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2026-58040 scores 7.5 on CVSS, so a successful attack would be serious — but at 0.28%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
Affected versions
Until: 18.20.4+dfsg-1~deb12u3
Fixed in: 18.20.4+dfsg-1~deb12u3
How to fix this CVE
Update Node.js to version 18.20.4+dfsg-1~deb12u3 or later to patch an incomplete TLS session reuse fix that allows hostname verification to be bypassed across different identity policies. This vulnerability affects HTTPS connections and could expose systems to man-in-the-middle attacks if exploited. Apply the update immediately to all Node.js instances across your infrastructure.
sudo dnf update nodejsDefensia detects this vulnerability
How to check if you are affected
- Run 'node --version' or 'nodejs --version' to check the installed Node.js version. Compare against the affected versions (22.x, 24.x, 26.x) and ensure you are not running a version prior to 18.20.4+dfsg-1~deb12u3.
- Examine your Node.js application code for HTTPS agent usage with tls.Agent or https.globalAgent to identify if TLS session reuse is enabled via 'keepAlive: true' or 'maxCachedSessions > 0'.
- Search application and system logs for patterns like 'EPROTO', 'certificate verify', 'ERR_TLS_CERT_ALTNAME_INVALID', or failed certificate validation errors that may indicate TLS session reuse mismatches.
- After patching, restart the Node.js service and run 'node --version' again to confirm the update. Test HTTPS connections to multiple domains to verify hostname verification is working correctly across session reuse.
FAQ
What is CVE-2026-58040?
CVE-2026-58040 is a TLS session reuse vulnerability in Node.js where the HTTPS agent incorrectly reuses cached TLS sessions without properly verifying the hostname of the destination server. This is an incomplete fix of an earlier vulnerability and could allow an attacker to bypass hostname verification when connecting to different services.
Is CVE-2026-58040 being actively exploited?
No, CVE-2026-58040 is not currently listed on the CISA Known Exploited Vulnerabilities (KEV) catalog, and no public exploits are available. However, the vulnerability should still be patched promptly as it affects TLS security.
What versions of Node.js are affected by CVE-2026-58040?
Node.js versions 22.x, 24.x, and 26.x are affected. Debian-based systems with nodejs versions prior to 18.20.4+dfsg-1~deb12u3 are vulnerable.
How do I check if my server is vulnerable to CVE-2026-58040?
Run 'node --version' and check if you are running Node.js 22.x, 24.x, or 26.x with a version number earlier than the patched version. On Debian systems, use 'apt show nodejs' to see the exact package version.
Does Defensia detect CVE-2026-58040?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Node.js is installed on a monitored server, CVE-2026-58040 will appear in your dashboard with remediation steps.
Related Node.js CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-58040. Free for 1 server.
Get started free