2 vulnerabilities classified as CWE-1335. AI Chinese analysis included.
CWE-1335 represents a logical weakness where an integer undergoes a bitwise shift using a negative value or a magnitude exceeding the data type’s bit width. This error typically stems from insufficient validation of shift operands, leading to undefined behavior or indeterminate results that vary across different architectures and compilers. Attackers may exploit this inconsistency to trigger unexpected program states, potentially causing crashes, data corruption, or bypassing security checks that rely on predictable bitwise operations. To prevent such vulnerabilities, developers must rigorously validate shift amounts before execution, ensuring they fall within the valid range of zero to the bit width minus one. Implementing strict input sanitization and utilizing static analysis tools can help detect these out-of-bounds shifts early in the development lifecycle, thereby maintaining code integrity and preventing exploitation through undefined behavior.
unsigned int r = 1 << -5;int choose_bit(int reg_bit, int bit_number_from_elsewhere) { if (NEED_TO_SHIFT) { reg_bit -= bit_number_from_elsewhere; } return reg_bit; } unsigned int handle_io_register(unsigned int *r) { unsigned int the_bit = 1 << choose_bit(5, 10); *r |= the_bit; return the_bit; }| CVE ID | Title | CVSS | Severity | Published |
|---|---|---|---|---|
| CVE-2026-4426 | Libarchive: libarchive: denial of service via malformed iso file processing — Red Hat Hardened Images | 6.5 | Medium | 2026-03-19 |
| CVE-2023-3161 | Linux kernel 安全漏洞 — Linux Kernel (fbcon) | 6.1 | - | 2023-06-12 |
Vulnerabilities classified as CWE-1335 represent 2 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.