---
title: "CWE-691: Insufficient Control Flow Management"
url: https://radicalnotion.ai/cwe/cwe-691
type: cwe
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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-691: Insufficient Control Flow Management

- **Abstraction:** Pillar
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 45
- **Of those, in CISA KEV:** 0
- **New in 2026:** 9
- **CWE catalog version:** 4.21

## 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.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Alter Execution Logic | - |

## Detection methods

### 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.)

## Demonstrative examples

### Example 1

The following function attempts to acquire a lock in order to perform operations on a shared resource.

Bad code:

```c
void f(pthread_mutex_t *mutex) {
    pthread_mutex_lock(mutex);

    /* access shared resource */

    pthread_mutex_unlock(mutex);
}
```

Good code:

```c
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);
}
```

### Example 2

In this example, the programmer has indented the statements to call Do\_X() and Do\_Y(), as if the intention is that these functions are only called when the condition is true. However, because there are no braces to signify the block, Do\_Y() will always be executed, even if the condition is false.

Bad code:

```c
if (condition==true)
    Do_X();
    Do_Y();
```

This might not be what the programmer intended. When the condition is critical for security, such as in making a security decision or detecting a critical error, this may produce a vulnerability.

### Example 3

This function prints the contents of a specified file requested by a user.

Bad code:

```php
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;
}
```

This code first reads a specified file into memory, then prints the file if the user is authorized to see its contents. The read of the file into memory may be resource intensive and is unnecessary if the user is not allowed to see the file anyway.

## Observed examples

| CVE | 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-561 (Dead Code) -\> CWE-295 (Improper Certificate Validation) -\> CWE-393 (Return of Wrong Status Code) -\> CWE-300 (Channel Accessible by Non-Endpoint). The code's whitespace indentation did not reflect the actual control flow (CWE-1114) and did not explicitly delimit the block (CWE-483), which could have made it more difficult for human code auditors to detect the vulnerability. |
| CVE-2011-1027 | Chain: off-by-one error (CWE-193) leads to infinite loop (CWE-835) using invalid hex-encoded characters. |

## Real CVEs with this weakness (sample of 12 of 45)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-115893 | Wasmtime: Cranelift backend on aarch64 can jump to incorrect target on large Wasm \`br\_table\` instruction | critical | 9.9 | - | No | 2026-10-23 |
| CVE-2024-3847 | Insufficient policy enforcement in WebUI | critical | 9.8 | - | No | 2024-04-17 |
| CVE-2026-79033 | Insufficient control flow management in DevTools | high | 8.8 | - | No | 2026-08-25 |
| CVE-2026-43503 | net: skbuff: propagate shared-frag marker through frag-transfer helpers | high | 8.8 | - | No | 2026-05-23 |
| CVE-2025-25273 | - | high | 8.8 | - | No | 2025-08-12 |
| CVE-2025-22893 | - | high | 8.8 | - | No | 2025-08-12 |
| CVE-2023-20559 | - | high | 8.8 | - | No | 2023-03-23 |
| CVE-2026-20276 | Cisco IOS XR Software Security Hardening Release: September 2026 | high | 8.6 | - | No | 2026-09-02 |
| CVE-2026-20271 | Cisco IOS XE Software Security Hardening Release | high | 8.6 | - | No | 2026-08-05 |
| CVE-2022-20697 | Cisco IOS and IOS XE Software Web Services Denial of Service Vulnerability | high | 8.6 | - | No | 2022-04-15 |
| CVE-2025-20004 | - | high | 8.5 | - | No | 2025-05-13 |
| CVE-2025-35963 | - | high | 8.3 | - | No | 2025-11-11 |

## Related attack patterns (CAPEC)

- [CAPEC-29](https://radicalnotion.ai/capec/capec-29): Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Child | [CWE-430](https://radicalnotion.ai/cwe/cwe-430) | Deployment of Wrong Handler |
| Child | [CWE-431](https://radicalnotion.ai/cwe/cwe-431) | Missing Handler |
| Child | [CWE-662](https://radicalnotion.ai/cwe/cwe-662) | Improper Synchronization |
| Child | [CWE-670](https://radicalnotion.ai/cwe/cwe-670) | Always-Incorrect Control Flow Implementation |
| Child | [CWE-696](https://radicalnotion.ai/cwe/cwe-696) | Incorrect Behavior Order |
| Child | [CWE-705](https://radicalnotion.ai/cwe/cwe-705) | Incorrect Control Flow Scoping |
| Child | [CWE-799](https://radicalnotion.ai/cwe/cwe-799) | Improper Control of Interaction Frequency |
| Child | [CWE-834](https://radicalnotion.ai/cwe/cwe-834) | Excessive Iteration |
| Child | [CWE-841](https://radicalnotion.ai/cwe/cwe-841) | Improper Enforcement of Behavioral Workflow |
| Child | [CWE-1281](https://radicalnotion.ai/cwe/cwe-1281) | Sequence of Processor Instructions Leads to Unexpected Behavior |
| Peer | [CWE-1434](https://radicalnotion.ai/cwe/cwe-1434) | Insecure Setting of Generative AI/ML Model Inference Parameters |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| WASC | Insufficient Process Validation | 40 | - |

## Frequently asked questions

### What is CWE-691?

The code does not sufficiently manage its control flow during execution, creating conditions in which the control flow can be modified in unexpected ways.

### What CVEs are caused by CWE-691?

45 recorded CVEs are attributed to CWE-691, including CVE-2026-115893, CVE-2024-3847 and CVE-2026-79033.

### How is CWE-691 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-691?

Exploiting CWE-691 can lead to: Alter Execution Logic.

### Is CWE-691 actively exploited?

45 recorded CVEs are caused by CWE-691; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/691.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-691). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
