CWE · MITRE source
CWE-242Use of Inherently Dangerous Function
The product calls a function that can never be guaranteed to work safely.
Certain functions behave in dangerous ways regardless of how they are used. Functions in this category were often implemented without taking security concerns into account. The gets() function is unsafe because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to gets() and overflow the destination buffer. Similarly, the >> operator is unsafe to use when reading into a statically-allocated character array because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to the >> operator and overflow the destination buffer.
Last updated: 20 August 2026 13:14 UTC
Control responseHuman-reviewed
Answering this weakness across the control lifecycle, from our framework cross-walks.
NIST 800-53 r5 controls that address this weakness (0)AI-assisted
| Control | Title | Family | Why it addresses this CWE |
|---|---|---|---|
| No NIST controls proposed yet. | |||
Top CVEs of this weakness type, ranked by Risk Priority
| CVE | Risk | CVSS | EPSS | Published |
|---|---|---|---|---|
CVE-2017-1002157 UPD | 7.8 | 9.8 | 0.0288 | 2019-01-10 |
CVE-2024-52324 | 7.4 | 9.8 | 0.0069 | 2024-12-06 |
CVE-2022-36310 UPD | 6.8 | 8.8 | 0.0151 | 2022-08-16 |
CVE-2026-6477 UPD | 6.6 | 8.8 | 0.0045 | 2026-05-14 |
CVE-2017-0904 UPD | 6.5 | 8.1 | 0.0242 | 2017-11-13 |
CVE-2025-49215 UPD | 6.4 | 8.8 | 0.0028 | 2025-06-17 |
CVE-2021-42543 UPD | 6.0 | 7.8 | 0.0077 | 2021-11-05 |
CVE-2025-1331 UPD | 5.7 | 7.8 | 0.0026 | 2025-05-08 |
CVE-2025-1994 UPD | 5.6 | 7.8 | 0.0016 | 2025-08-26 |
CVE-2021-40698 UPD | 5.5 | 7.4 | 0.0054 | 2023-09-07 |
CVE-2026-11980 UPD | 5.3 | 7.3 | 0.0017 | 2026-07-30 |