cve.bz

CAPEC-92

Forced Integer Overflow

High severityHigh likelihoodDetailed pattern

This attack forces an integer variable to go out of range. The integer variable is often used as an offset such as size of memory allocation or similarly. The attacker would typically control the value of such variable and try to get it out of range. For instance the integer in question is incremented past the maximum possible value, it may wrap to become a very small, or negative number, therefore providing a very incorrect value which can lead to unexpected behavior. At worst the attacker can execute arbitrary code.

On this page

Ask an AI about this attack pattern

Show the promptExplain the attack pattern CAPEC-92: Forced Integer Overflow: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/92.html and https://cve.bz/cve/capec/92?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.

How the attack unfolds

  1. Explore

    The attacker looks for a way in.

    1. The first step is exploratory meaning the attacker looks for an integer variable that they can control.

  2. Experiment

    They probe what they found.

    1. The attacker finds an integer variable that they can write into or manipulate and try to get the value of the integer out of the possible range.

  3. Exploit

    They carry out the attack.

    1. The integer variable is forced to have a value out of range which set its final value to an unexpected value.

    2. The target host acts on the data and unexpected behavior may happen.

Prerequisites

  • The attacker can manipulate the value of an integer variable utilized by the target host.

  • The target host does not do proper range checking on the variable before utilizing it.

  • When the integer variable is incremented or decremented to an out of range value, it gets a very different value (e.g. very small or negative number)

Skills required

  • Low skill

    An attacker can simply overflow an integer by inserting an out of range value.

  • High skill

    Exploiting a buffer overflow by injecting malicious code into the stack of a software system or even the heap can require a higher skill level.

Consequences

What a successful attack can lead to
ImpactAffectsNote
Modify DataIntegrity
Gain PrivilegesConfidentiality, Access Control, Authorization
Execute Unauthorized CommandsConfidentiality, Integrity, AvailabilityRun Arbitrary Code
Read DataConfidentiality
Unreliable ExecutionAvailability

Mitigations

  • Use a language or compiler that performs automatic bounds checking.

  • Carefully review the service's implementation before making it available to user. For instance you can use manual or automated code review to uncover vulnerabilities such as integer overflow.

  • Use an abstraction library to abstract away risky APIs. Not a complete solution.

  • Always do bound checking before consuming user input data.

Weaknesses it exploits

  • CWE-120 Buffer Copy without Checking Size of Input
  • CWE-122 Heap-based Buffer Overflow
  • CWE-128 Wrap-around Error
  • CWE-190 Integer Overflow or Wraparound
  • CWE-196 Unsigned to Signed Conversion Error
  • CWE-680 Integer Overflow to Buffer Overflow
  • CWE-697 Incorrect Comparison

Recent CVEs with these weaknesses

  1. 8.8CVE-2026-124947

    Incorrect boundary conditions in the Graphics component. This vulnerability was fixed in Firefox 160.

  2. 8.8CVE-2026-124926

    Incorrect boundary conditions in the WebRTC component. This vulnerability was fixed in Firefox 160 and Firefox ESR 153.7.

  3. 8.8CVE-2026-124924

    Incorrect boundary conditions in the Graphics: WebRender component. This vulnerability was fixed in Firefox 160 and Firefox ESR 153.7.

  4. 8.8CVE-2026-124918

    Privilege escalation due to incorrect boundary conditions in the Graphics: WebRender component. This vulnerability was fixed in Firefox 160 and Firefox ESR 153.7.

  5. 8.8CVE-2026-124915

    Incorrect boundary conditions in the Graphics: WebGPU component. This vulnerability was fixed in Firefox 160 and Firefox ESR 153.7.

  6. 8.8CVE-2026-124891

    Incorrect boundary conditions in the DOM: Selection component. This vulnerability was fixed in Firefox 160 and Firefox ESR 153.7.

  7. 8.8CVE-2026-124888

    Incorrect boundary conditions in the Layout: Text and Fonts component. This vulnerability was fixed in Firefox 160 and Firefox ESR 153.7.

  8. 8.8CVE-2026-124887

    Incorrect boundary conditions in the Layout: Text and Fonts component. This vulnerability was fixed in Firefox 160 and Firefox ESR 153.7.

The newest records naming one of them. Each weakness's page lists them all.

Part of

Examples

Integer overflow in the ProcAuWriteElement function in server/dia/audispatch.c in Network Audio System (NAS) …

Integer overflow in the ProcAuWriteElement function in server/dia/audispatch.c in Network Audio System (NAS) before 1.8a SVN 237 allows remote attackers to cause a denial of service (crash) and possibly execute arbitrary code via a large max_samples value. See also: CVE-2007-1544

The following code illustrates an integer overflow. The declaration of total integer as "unsigned short int" …

The following code illustrates an integer overflow. The declaration of total integer as "unsigned short int" assumes that the length of the first and second arguments fits in such an integer [REF-547], [REF-548].

include<stdlib.h>
include<string.h>
include<stdio.h>

int main (int argc, char *const *argv)
{
  if (argc !=3){
    printf("Usage: prog_name<string1><string2>\n");
    exit(-1);

  }
  unsigned short int total;
  total = strlen(argv[1])+strlen(argv[2])+1;
  char * buff = (char *)malloc(total);
  strcpy(buff, argv[1]);
  strcpy(buff, argv[2]);

}

MITRE's words, unchanged: CAPEC-92 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.