引入方式
Implementation : A developer might use shifts without
properly verifying the size and sign of
the shift amount.
适用平台
编程语言
名称: C (Undetermined)
名称: C++ (Undetermined)
名称: C# (Undetermined)
名称: Java (Undetermined)
名称: JavaScript (Undetermined)
名称: Python (Undetermined)
操作系统
类: Not OS-Specific (Undetermined)
技术
类: Not Technology-Specific (Undetermined)
常见后果
| 影响范围 |
影响 |
可能性 |
| Integrity | DoS: Crash, Exit, or Restart | |
| Other | Undefined Behavior, Unexpected State, Alter Execution Logic | |
观察示例
| 参考资料 |
描述 |
| multimedia product performs a left shift with a negative value, leading to a crash |
| An unexpected large value in the ext4 filesystem causes an overshift condition resulting in a divide by zero. |
| An unexpected large value in the ext4 filesystem causes an overshift condition resulting in a divide by zero - fix of CVE-2009-4307. |
| An overshift in a kernel allowed out of bounds reads and writes resulting in a root takeover. |
| Program is not properly handling signed bitwise left-shifts causing an overlapping memcpy memory range error. |
| Compression function improperly executes a signed left shift of a negative integer. |
| Some kernels improperly handle right shifts of 32 bit numbers in a 64 bit register. |
| Putty has an incorrectly sized shift value resulting in an overshift. |
| LED driver overshifts under certain conditions resulting in a DoS. |
潜在缓解措施
Phases : Implementation
Implicitly or explicitly add checks and mitigation for negative or over-shift values.
检测方法
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.)
有效性 : High
漏洞映射说明
依据 : 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.
备注 : 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.
参考资料
REF-1541
Secure Coding Guide for Python
OpenSSF.
https://best.openssf.org/Secure-Coding-Guide-for-Python/
提交记录
| 名称 |
组织 |
日期 |
发布日期 |
Version |
| CWE Content Team |
MITRE |
2021-03-29 +00:00 |
2021-07-20 +00:00 |
4.5 |
修改记录
| 名称 |
组织 |
日期 |
备注 |
| 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 |
| CWE Content Team |
MITRE |
2026-04-30 +00:00 |
updated Observed_Examples |
| CWE Content Team |
MITRE |
2026-10-28 +00:00 |
updated Applicable_Platforms, Common_Consequences, Description, Modes_of_Introduction, References, Relationships, Taxonomy_Mappings |