The product does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the product.
N/A
Threat Mapped score: 0.0
Industry: Finiancial
Threat priority: Unclassified
CVE: [REF-1374]
Chain: JavaScript-based cryptocurrency library can fall back to the insecure Math.random() function instead of reporting a failure (CWE-392), thus reducing the entropy (CWE-332) and leading to generation of non-unique cryptographic keys for Bitcoin wallets (CWE-1391)
CVE: CVE-2022-22224
Chain: an operating system does not properly process malformed Open Shortest Path First (OSPF) Type/Length/Value Identifiers (TLV) (CWE-703), which can cause the process to enter an infinite loop (CWE-835)
N/A
N/A
Phase | Note |
---|---|
Architecture and Design | N/A |
Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |
Operation | N/A |
Intro: Consider the following code segment:
Body: The programmer expects that when fgets() returns, buf will contain a null-terminated string of length 9 or less. But if an I/O error occurs, fgets() will not null-terminate buf. Furthermore, if the end of the file is reached before any characters are read, fgets() returns without writing anything to buf. In both of these situations, fgets() signals that something unusual has happened by returning NULL, but in this code, the warning will not be noticed. The lack of a null terminator in buf can result in a buffer overflow in the subsequent call to strcpy().
char buf[10], cp_buf[10]; fgets(buf, 10, stdin); strcpy(cp_buf, buf);
Intro: The following method throws three types of exceptions.
Body: While it might seem tidier to write
public void doExchange() throws IOException, InvocationTargetException, SQLException { ... }