Cyber Resilience

CWE · MITRE source

CWE-242Use of Inherently Dangerous Function

Abstraction: Base · CVEs in our corpus: 11

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.

Prevent
Stop it (NIST 800-53 / CSF Protect)
  • PR.PS-06
  • SA-11 Developer Testing and Evaluation
  • SA-8 Security and Privacy Engineering Principles
  • SA-15 Development Process, Standards, and Tools
Detect
Catch it (CSF Detect / Respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)

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 7.89.80.02882019-01-10
CVE-2024-523247.49.80.00692024-12-06
CVE-2022-36310 6.88.80.01512022-08-16
CVE-2026-6477 6.68.80.00452026-05-14
CVE-2017-0904 6.58.10.02422017-11-13
CVE-2025-49215 6.48.80.00282025-06-17
CVE-2021-42543 6.07.80.00772021-11-05
CVE-2025-1331 5.77.80.00262025-05-08
CVE-2025-1994 5.67.80.00162025-08-26
CVE-2021-40698 5.57.40.00542023-09-07
CVE-2026-11980 5.37.30.00172026-07-30