- What is CWE-193?
- A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.
- What CVEs are caused by CWE-193?
- 94 recorded CVEs are attributed to CWE-193, including CVE-2021-3156, CVE-2025-54349, CVE-2024-10442. 1 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.
- How do you prevent CWE-193?
- When copying character arrays or using character manipulation methods, the correct size parameter must be used to account for the null terminator that needs to be added at the end of the array. Some examples of functions susceptible to this weakness in C include strcpy(), strncpy(), strcat(), strncat(), printf(), sprintf(), scanf() and sscanf().
- How is CWE-193 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-193?
- Exploiting CWE-193 can lead to: DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory), DoS: Instability, Modify Memory, Execute Unauthorized Code or Commands.
- Is CWE-193 actively exploited?
- Yes. 1 CWE-193 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 94 recorded CVEs.