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: 14 October 2026 20:41 UTC
Control responseHuman-reviewed
Answering this weakness across the control lifecycle, from our framework cross-walks.
NIST 800-53 r5 controls PROPOSED for this weakness (0)AI-assisted
These are model PROPOSALS, not graded mappings. They come
from controls_to_cwe_proposals, which carries no grade field at
all; across the CWE pages 1,540 of 1,722 such associations (89%) have never
been graded by anything. The heading said “address” until
2026-09-29, which asserted a relationship the data does not carry.
Graded cross-walks are on the framework map, not here.
| 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.9 | 8.8 | 0.0158 | 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.5 | 8.8 | 0.0033 | 2025-06-17 |
CVE-2021-42543 UPD | 6.0 | 7.8 | 0.0081 | 2021-11-05 |
CVE-2025-1331 UPD | 5.7 | 7.8 | 0.0028 | 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.0055 | 2023-09-07 |
CVE-2026-11980 UPD | 5.3 | 7.3 | 0.0017 | 2026-07-30 |