CWE-1335 Detalhe

CWE-1335

Incorrect Bitwise Shift of Integer
Draft
2021-07-20
00h00 +00:00
2025-12-11
00h00 +00:00
Notificações para um CWE
Fique informado sobre quaisquer alterações para um CWE específico.
Gerenciar notificações

Nome: Incorrect Bitwise Shift of Integer

An integer value is specified to be shifted by a negative amount or an amount greater than or equal to the number of bits contained in the value causing an unexpected or indeterminate result.

Informações Gerais

Modos de Introdução

Implementation : Adding shifts without properly verifying the size and sign of the shift amount.

Plataformas Aplicáveis

Linguagem

Name: C (Undetermined)
Name: C++ (Undetermined)
Name: C# (Undetermined)
Name: Java (Undetermined)
Name: JavaScript (Undetermined)

Sistemas Operacionais

Class: Not OS-Specific (Undetermined)

Tecnologias

Class: Not Technology-Specific (Undetermined)

Consequências Comuns

Escopo Impacto Probabilidade
IntegrityDoS: Crash, Exit, or Restart

Exemplos Observados

Referências Descrição

CVE-2009-4307

An unexpected large value in the ext4 filesystem causes an overshift condition resulting in a divide by zero.

CVE-2012-2100

An unexpected large value in the ext4 filesystem causes an overshift condition resulting in a divide by zero - fix of CVE-2009-4307.

CVE-2020-8835

An overshift in a kernel allowed out of bounds reads and writes resulting in a root takeover.

CVE-2015-1607

Program is not properly handling signed bitwise left-shifts causing an overlapping memcpy memory range error.

CVE-2016-9842

Compression function improperly executes a signed left shift of a negative integer.

CVE-2018-18445

Some kernels improperly handle right shifts of 32 bit numbers in a 64 bit register.

CVE-2013-4206

Putty has an incorrectly sized shift value resulting in an overshift.

CVE-2018-20788

LED driver overshifts under certain conditions resulting in a DoS.

Mitigações Potenciais

Phases : Implementation
Implicitly or explicitly add checks and mitigation for negative or over-shift values.

Métodos de Detecção

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.)
Eficácia : High

Notas de Mapeamento de Vulnerabilidade

Justificativa : This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Comentário : Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

Submissão

Nome Organização Data Data de lançamento Version
CWE Content Team MITRE 2021-03-29 +00:00 2021-07-20 +00:00 4.5

Modificações

Nome Organização Data Comentário
CWE Content Team MITRE 2022-10-13 +00:00 updated Demonstrative_Examples, Observed_Examples
CWE Content Team MITRE 2023-04-27 +00:00 updated Relationships
CWE Content Team MITRE 2023-06-29 +00:00 updated Mapping_Notes
CWE Content Team MITRE 2025-12-11 +00:00 updated Detection_Factors, Weakness_Ordinalities