Skip to content
OpenAdvisories

Weakness (CWE)

CWE-1335: Incorrect Bitwise Shift of Integer

Base Draft

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.

More detail

Specifying a value to be shifted by a negative amount is undefined in various languages. Various computer architectures implement this action in different ways. The compilers and interpreters when generating code to accomplish a shift generally do not do a check for this issue.

Specifying an over-shift - a shift greater than or equal to the number of bits contained in a value to be shifted - produces a result that varies by architecture and compiler. In some languages, this action is undefined.

How to prevent it (1 mitigation)
  1. Implementation

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

Source: MITRE CWE-1335

4 results · Clear filters · Feed

  • Medium 6.5

    ptp: Potential Denial of Service via PTP Interval Shift

    A bitwise shift vulnerability in Zephyr's PTP subsystem allows a remote attacker to cause undefined behavior and potential system crashes. An attacker sends a crafted PTP_MSG_MANAGEMENT message to set an unvalidated negative log_announce_interval value in the…

  • Medium 6.5

    Libarchive: libarchive: denial of service via malformed iso file processing

    A flaw was found in libarchive. An Undefined Behavior vulnerability exists in the zisofs decompression logic, caused by improper validation of a field (`pz_log2_bs`) read from ISO9660 Rock Ridge extensions. A remote attacker can exploit this by supplying a sp…

  • Medium 6.9

    ts-asn1-der has Incorrect DER Encoding of Numbers Leading to Denial of Service and Incorrect Value Representation

    ts-asn1-der is a collection of utility classes to encode ASN.1 data following DER rule. Incorrect number DER encoding can lead to denial on service for absolute values in the range 2**31 -- 2**32 - 1. The arithmetic in the numBitLen didn't take into account t…

  • Medium 5.5

    A flaw was found in the Framebuffer Console (fbcon) in the Linux Kernel. When providing font->width and font->height gr…