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: 15 May 2026 07:07 UTC
NIST 800-53 r5 controls that address this weakness (0)AI
| 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 | 2.0 | 9.8 | 0.0137 | 2019-01-10 |
CVE-2024-52324 | 2.0 | 9.8 | 0.0013 | 2024-12-06 |
CVE-2022-36310 | 1.8 | 8.8 | 0.0095 | 2022-08-16 |
CVE-2025-49215 | 1.8 | 8.8 | 0.0013 | 2025-06-17 |
CVE-2026-6477 | 1.8 | 8.8 | 0.0000 | 2026-05-14 |
CVE-2017-0904 UPD | 1.7 | 8.1 | 0.0086 | 2017-11-13 |
CVE-2021-42543 | 1.6 | 7.8 | 0.0017 | 2021-11-05 |
CVE-2025-1331 | 1.6 | 7.8 | 0.0004 | 2025-05-08 |
CVE-2025-1994 | 1.6 | 7.8 | 0.0002 | 2025-08-26 |
CVE-2021-40698 | 1.5 | 7.4 | 0.0012 | 2023-09-07 |