Description
The code does not sufficiently manage its control flow during execution, creating conditions in which the control flow can be modified in unexpected ways.
Potential Impact
Other
Alter Execution Logic
Demonstrative Examples
void f(pthread_mutex_t *mutex) {
pthread_mutex_lock(mutex);
/* access shared resource */
pthread_mutex_unlock(mutex);
}int f(pthread_mutex_t *mutex) {
int result;
result = pthread_mutex_lock(mutex);if (0 != result)return result;
/* access shared resource */
return pthread_mutex_unlock(mutex);
}if (condition==true)Do_X();Do_Y();function printFile($username,$filename){
//read file into string
$file = file_get_contents($filename);if ($file && isOwnerOf($username,$filename)){echo $file;return true;}else{echo 'You are not authorized to view this file';}return false;
}Real-World CVE Examples
| CVE ID | Description |
|---|---|
| CVE-2024-50653 | e-commerce product does not restrict the number of requests for coupons |
| CVE-2019-9805 | Chain: Creation of the packet client occurs before initialization is complete (CWE-696) resulting in a read from uninitialized memory (CWE-908), causing memory corruption. |
| CVE-2014-1266 | Chain: incorrect "goto" in Apple SSL product bypasses certificate validation, allowing Adversary-in-the-Middle (AITM) attack (Apple "goto fail" bug). CWE-705 (Incorrect Control Flow Scoping) -> CWE-56 |
| CVE-2011-1027 | Chain: off-by-one error (CWE-193) leads to infinite loop (CWE-835) using invalid hex-encoded characters. |
Taxonomy Mappings
- WASC: 40 — Insufficient Process Validation
Frequently Asked Questions
What is CWE-691?
CWE-691 (Insufficient Control Flow Management) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Pillar-level weakness. The code does not sufficiently manage its control flow during execution, creating conditions in which the control flow can be modified in unexpected ways.
How can CWE-691 be exploited?
Attackers can exploit CWE-691 (Insufficient Control Flow Management) to alter execution logic. This weakness is typically introduced during the Architecture and Design, Implementation phase of software development.
How do I prevent CWE-691?
Follow secure coding practices, conduct code reviews, and use automated security testing tools (SAST/DAST) to detect this weakness early in the development lifecycle.
What is the severity of CWE-691?
CWE-691 is classified as a Pillar-level weakness (Foundational abstraction). It has been observed in 4 real-world CVEs.