目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1000

100.0%

CWE-1335 类漏洞列表 2

CWE-1335 类弱点 2 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-1335 属于整数运算错误漏洞,指对整数执行负数或超出位宽的位移操作,导致未定义或不可预测的结果。攻击者可利用此缺陷引发程序崩溃、逻辑混乱或数据损坏,进而可能实现远程代码执行。开发者应避免使用不可控的位移量,在代码中严格校验位移参数范围,确保其非负且小于数据类型位宽,从而消除潜在的安全隐患。

MITRE CWE 官方描述
CWE:CWE-1335 整数位运算移位错误(Incorrect Bitwise Shift of Integer) 指定将一个整数值移位一个负数,或移位一个大于或等于该值所含位数的数量,从而导致意外或不确定的结果。 在多种编程语言中,指定移位一个负数的操作是未定义的(undefined)。不同的计算机体系结构以不同的方式实现此操作。编译器(compilers)和解释器(interpreters)在生成执行移位操作的代码时,通常不会对此问题进行检查。指定一个过度移位(over-shift),即移位量大于或等于待移位值所包含的位数,会产生因体系结构和编译器而异的结果。在某些语言中,此操作被明确列为产生未定义(undefined)结果。
常见影响 (1)
IntegrityDoS: Crash, Exit, or Restart
缓解措施 (1)
ImplementationImplicitly or explicitly add checks and mitigation for negative or over-shift values.
代码示例 (1)
A negative shift amount for an x86 or x86_64 shift instruction will produce the number of bits to be shifted by taking a 2's-complement of the shift amount and effectively masking that amount to the lowest 6 bits for a 64 bit shift instruction.
unsigned int r = 1 << -5;
Bad · C
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; }
Bad · C
CVE ID标题CVSS风险等级Published
CVE-2026-4426 libarchive 安全漏洞 — Red Hat Hardened Images 6.5 Medium2026-03-19
CVE-2023-3161 Linux kernel 安全漏洞 — Linux Kernel (fbcon) 6.1 -2023-06-12

CWE-1335 是常见的弱点类别,本平台收录该类弱点关联的 2 条 CVE 漏洞。