# CVE-2021-22931: Node.js 14 and 2 others: Improper Null Termination (CWE-170)

CVE-2021-22931 is fixed in 10 products on 2 platforms, first by Node.js 12 12.22.5, released August 11, 2021. It is not reported as exploited. Patch Radar priority: High.

- Web page: https://patchblox.com/security/cve/CVE-2021-22931
- Priority: High
- CVSS: 9.8 (Important)
- EPSS: 0.2195
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Aug 16, 2021
- Weakness: CWE-170: Improper Null Termination (CWE-170)
- Vendor advisory: https://nvd.nist.gov/vuln/detail/CVE-2021-22931

## Description

Node.js before 16.6.0, 14.17.4, and 12.22.4 is vulnerable to Remote Code Execution, XSS, Application crashes due to missing input validation of host names returned by Domain Name Servers in Node.js dns library which can lead to output of wrong hostnames (leading to Domain Hijacking) and injection vulnerabilities in applications using the library.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Windows apps | Node.js 12 | 12.22.5 | [Node.js 12 12.22.5](https://patchblox.com/security/data/fix/windows-app/openjs.nodejs.12-12.22.5.md) | Aug 11, 2021 |
| Windows apps | Node.js 14 | 14.17.5 | [Node.js 14 14.17.5](https://patchblox.com/security/data/fix/windows-app/openjs.nodejs.14-14.17.5.md) | Aug 11, 2021 |
| Windows apps | Node.js 16 | 16.6.2 | [Node.js 16 16.6.2](https://patchblox.com/security/data/fix/windows-app/openjs.nodejs.16-16.6.2.md) | Aug 11, 2021 |
| Linux | nodejs RHEL 8 | 1:14.17.5-1.module+el8.4.0+12247+e2879e58 | [RHSA-2021:3666](https://patchblox.com/security/data/fix/linux/rhsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs ol 8 | 1:14.17.5-1.module+el8.4.0+20313+f90c2973 | [ELSA-2021-3666](https://patchblox.com/security/data/fix/linux/elsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-devel RHEL 8 | 1:14.17.5-1.module+el8.4.0+12247+e2879e58 | [RHSA-2021:3666](https://patchblox.com/security/data/fix/linux/rhsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-devel ol 8 | 1:14.17.5-1.module+el8.4.0+20313+f90c2973 | [ELSA-2021-3666](https://patchblox.com/security/data/fix/linux/elsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-docs RHEL 8 | 1:14.17.5-1.module+el8.4.0+12247+e2879e58 | [RHSA-2021:3666](https://patchblox.com/security/data/fix/linux/rhsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-docs ol 8 | 1:14.17.5-1.module+el8.4.0+20313+f90c2973 | [ELSA-2021-3666](https://patchblox.com/security/data/fix/linux/elsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-full-i18n RHEL 8 | 1:14.17.5-1.module+el8.4.0+12247+e2879e58 | [RHSA-2021:3666](https://patchblox.com/security/data/fix/linux/rhsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-full-i18n ol 8 | 1:14.17.5-1.module+el8.4.0+20313+f90c2973 | [ELSA-2021-3666](https://patchblox.com/security/data/fix/linux/elsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-nodemon RHEL 8 | 0:2.0.3-1.module+el8.3.0+6519+9f98ed83 | [RHSA-2021:3666](https://patchblox.com/security/data/fix/linux/rhsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-nodemon ol 8 | 0:2.0.3-1.module+el8.3.0+7818+6cd30d85 | [ELSA-2021-3666](https://patchblox.com/security/data/fix/linux/elsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-packaging RHEL 8 | 0:23-3.module+el8.3.0+6519+9f98ed83 | [RHSA-2021:3666](https://patchblox.com/security/data/fix/linux/rhsa-2021-3666.md) | Sep 27, 2021 |
| Linux | nodejs-packaging ol 8 | 0:23-3.module+el8.3.0+7818+6cd30d85 | [ELSA-2021-3666](https://patchblox.com/security/data/fix/linux/elsa-2021-3666.md) | Sep 27, 2021 |
| Linux | npm RHEL 8 | 1:6.14.14-1.14.17.5.1.module+el8.4.0+12247+e2879e58 | [RHSA-2021:3666](https://patchblox.com/security/data/fix/linux/rhsa-2021-3666.md) | Sep 27, 2021 |
| Linux | npm ol 8 | 1:6.14.14-1.14.17.5.1.module+el8.4.0+20313+f90c2973 | [ELSA-2021-3666](https://patchblox.com/security/data/fix/linux/elsa-2021-3666.md) | Sep 27, 2021 |

---

Data as of 2026-11-09T01:18:40Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
