CWE

普遍的弱点

社区开发的软件和硬件弱点类型清单

2021 CWE Most Important Hardware Weaknesses
CWE Top 25 Most Dangerous Weaknesses
>CWE列表> cwe-单个字典定义(4.10)
ID

CWE-125:不合时宜的阅读

弱点ID:125
抽象:根据
结构:Simple
查看自定义信息:
+描述
该产品在预期的缓冲区的末端或开始之前读取数据。
+扩展描述
通常,这可以允许攻击者从其他内存位置读取敏感信息或导致崩溃。当代码读取可变数量的数据并假设存在哨兵以停止读取操作时,例如字符串中的nul时,可能会发生崩溃。预期的哨兵可能不会位于越野内存中,导致读取过多的数据,从而导致分割故障或缓冲区溢出。该产品可能会修改索引或执行指针算术,该指针算术引用一个在缓冲区边界之外的内存位置。然后,随后的读取操作会产生未定义或意外的结果。
+关系
部分帮助该表显示了与该弱点相关的弱点和高级类别。这些关系定义为childof,parentof,ementof,并深入了解可能存在于较高和较低抽象水平的类似项目。此外,定义了诸如Peerof和Canalsobe之类的关系,以显示用户可能想要探索的类似弱点。
+与观点“研究概念”相关(CWE-1000)
Nature 类型 ID 姓名
ChildOf 班级班级 - 以非常抽象的方式描述的弱点,通常与任何特定的语言或技术无关。比支柱弱点更具体,但比基本弱点更一般。班级弱点通常用以下维度的1或2来描述问题:行为,属性和资源。 119 Improper Restriction of Operations within the Bounds of a Memory Buffer
父母 变体变体 - 与某种类型的产品相关的弱点,通常涉及特定的语言或技术。比基本弱点更具体。变体级别的弱点通常以以下维度的3到5来描述问题:行为,财产,技术,语言和资源。 126 缓冲区超阅读
父母 变体变体 - 与某种类型的产品相关的弱点,通常涉及特定的语言或技术。比基本弱点更具体。变体级别的弱点通常以以下维度的3到5来描述问题:行为,财产,技术,语言和资源。 127 缓冲区阅读
可以按照 根据基础 - 仍然主要独立于资源或技术的弱点,但有足够的细节来提供特定的检测和预防方法。基本水平的弱点通常用以下维度的2或3来描述问题:行为,财产,技术,语言和资源。 822 不受信任的指针退份
可以按照 根据基础 - 仍然主要独立于资源或技术的弱点,但有足够的细节来提供特定的检测和预防方法。基本水平的弱点通常用以下维度的2或3来描述问题:行为,财产,技术,语言和资源。 823 Use of Out-of-range Pointer Offset
可以按照 根据基础 - 仍然主要独立于资源或技术的弱点,但有足够的细节来提供特定的检测和预防方法。基本水平的弱点通常用以下维度的2或3来描述问题:行为,财产,技术,语言和资源。 824 访问非初始化指针
可以按照 根据基础 - 仍然主要独立于资源或技术的弱点,但有足够的细节来提供特定的检测和预防方法。基本水平的弱点通常用以下维度的2或3来描述问题:行为,财产,技术,语言和资源。 825 过期的指针退出
部分帮助该表显示了与该弱点相关的弱点和高级类别。这些关系定义为childof,parentof,ementof,并深入了解可能存在于较高和较低抽象水平的类似项目。此外,定义了诸如Peerof和Canalsobe之类的关系,以显示用户可能想要探索的类似弱点。
+与“软件开发”视图相关(CWE-699)
Nature 类型 ID 姓名
成员 类别类别 - 包含共享共同特征的其他条目的CWE条目。 1218 内存缓冲区错误
部分帮助该表显示了与该弱点相关的弱点和高级类别。这些关系定义为childof,parentof,ementof,并深入了解可能存在于较高和较低抽象水平的类似项目。此外,定义了诸如Peerof和Canalsobe之类的关系,以显示用户可能想要探索的类似弱点。
+与“简化已发表漏洞的简化映射”(CWE-1003)相关的视图相关(CWE-1003)
Nature 类型 ID 姓名
ChildOf 班级班级 - 以非常抽象的方式描述的弱点,通常与任何特定的语言或技术无关。比支柱弱点更具体,但比基本弱点更一般。班级弱点通常用以下维度的1或2来描述问题:行为,属性和资源。 119 Improper Restriction of Operations within the Bounds of a Memory Buffer
部分帮助该表显示了与该弱点相关的弱点和高级类别。这些关系定义为childof,parentof,ementof,并深入了解可能存在于较高和较低抽象水平的类似项目。此外,定义了诸如Peerof和Canalsobe之类的关系,以显示用户可能想要探索的类似弱点。
+与“ CISQ质量措施(2020)”相关(CWE-1305)
Nature 类型 ID 姓名
ChildOf 班级班级 - 以非常抽象的方式描述的弱点,通常与任何特定的语言或技术无关。比支柱弱点更具体,但比基本弱点更一般。班级弱点通常用以下维度的1或2来描述问题:行为,属性和资源。 119 Improper Restriction of Operations within the Bounds of a Memory Buffer
部分帮助该表显示了与该弱点相关的弱点和高级类别。这些关系定义为childof,parentof,ementof,并深入了解可能存在于较高和较低抽象水平的类似项目。此外,定义了诸如Peerof和Canalsobe之类的关系,以显示用户可能想要探索的类似弱点。
+Relevant to the view "CISQ Data Protection Measures" (CWE-1340)
Nature 类型 ID 姓名
ChildOf 班级班级 - 以非常抽象的方式描述的弱点,通常与任何特定的语言或技术无关。比支柱弱点更具体,但比基本弱点更一般。班级弱点通常用以下维度的1或2来描述问题:行为,属性和资源。 119 Improper Restriction of Operations within the Bounds of a Memory Buffer
+Modes Of Introduction
部分帮助The different Modes of Introduction provide information about how and when this weakness may be introduced. The Phase identifies a point in the life cycle at which introduction may occur, while the Note provides a typical scenario related to introduction during the given phase.
阶段 Note
执行
+适用的平台
部分帮助This listing shows possible areas for which the given weakness could appear. These may be for specific named Languages, Operating Systems, Architectures, Paradigms, Technologies, or a class of such platforms. The platform is listed along with how frequently the given weakness appears for that instance.

Languages

C(不确定的患病率)

C ++(不确定的患病率)

技术

班级:ICS/OT(通常很普遍)

+Common Consequences
部分帮助This table specifies different individual consequences associated with the weakness. The Scope identifies the application security area that is violated, while the Impact describes the negative technical impact that arises if an adversary succeeds in exploiting this weakness. The Likelihood provides information about how likely the specific consequence is expected to be seen relative to the other consequences in the list. For example, there may be high likelihood that a weakness will be exploited to achieve a certain impact, but a low likelihood that it will be exploited to achieve a different impact.
范围 影响 可能性
保密

Technical Impact:阅读内存

保密

Technical Impact:旁路保护机制

通过读取越野内存,攻击者可能能够获得秘密值,例如内存地址,可以是旁路保护机制,例如ASLR,以提高利用单独弱点以实现代码执行的可靠性和可能性而不仅仅是拒绝服务。
+示例的例子

示例1

In the following code, the method retrieves a value from an array at a specific array index location that is given as an input parameter to the method

(不良代码)
示例语言:C
int getValueFromArray(int *array,int len,int index){

int值;

// check that the array index is less than the maximum

//阵列的长度
if(index

//在数组的指定索引处获取值
value = array[index];
}
// if array index is invalid then output error message

//和返回值指示错误
别的 {
printf(“值为:%d \ n”,数组[index]);
值= -1;
}

return value;
}

但是,此方法仅验证给定数组索引小于数组的最大长度,但未检查最小值(CWE-839)。这将使负值被接受为输入阵列索引,这将导致范围读取(CWE-125)并可能允许访问敏感的内存。应检查输入数组索引以验证数组所需的最大值和最小范围(CWE-129)。在此示例中,应修改IF语句以包括最小范围检查,如下所示。

(好代码)
示例语言:C

。。。

//检查数组索引是否在正确的

//数组的值范围
if(index> = 0 && index
。。。
+观察到的例子
参考 描述
如野生CISA KEV所利用的嵌入式系统中使用的IP堆栈中读取的距离。
Chain: "Heartbleed" bug receives an inconsistent length parameter (CWE-130)启用无界读取(CWE-126), returning memory that could include private cryptographic keys and other sensitive data.
Chain: unexpected sign extension (CWE-194)导致整数溢出(CWE-190), causing an out-of-bounds read (CWE-125)
链:当输入字符串未终止时,产品不会处理(CWE-170),导致缓冲区过度阅读(CWE-125)或基于堆的缓冲区溢出(CWE-122)。
链:一系列浮点精度错误(CWE-1339)在Web浏览器渲染引擎中,导致出现外部原因(阅读)(CWE-125),访问跨原始数据
out-of-bounds read due to improper length check
具有大量指定元素的数据包导致读取。
具有大量指定元素的数据包导致读取。
从整数下流读取的距离读取
large length value causes out-of-bounds read
畸形的图像导致无界图阅读
OS内核信任Userland提供的长度价值,允许阅读敏感信息
+潜在的缓解

阶段:实施

Strategy: Input Validation

Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.

When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."

Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

为了减少引入越野读数的可能性,请确保您验证并确保正确计算任何长度参数,缓冲区大小计算或偏移。要特别谨慎地依靠不信任输入中的前哨(即特殊特征,例如nul)。

阶段:建筑和设计

策略:语言选择

使用提供适当内存抽象的语言。
+弱点
Ordinality 描述
基本的
(弱点独立于其他弱点的地方)
+会员资格
部分帮助此成员关系表显示了其他CWE类别和视图,将此弱点称为成员。该信息通常可用于理解弱点适合外部信息源的何处。
Nature 类型 ID 姓名
成员 类别类别 - 包含共享共同特征的其他条目的CWE条目。 970 SFP Secondary Cluster: Faulty Buffer Access
成员 类别类别 - 包含共享共同特征的其他条目的CWE条目。 1157 SEI CERT C编码标准 - 指南03.表达式(EXP)
成员 类别类别 - 包含共享共同特征的其他条目的CWE条目。 1160 SEI CERT C Coding Standard - Guidelines 06. Arrays (ARR)
成员 类别类别 - 包含共享共同特征的其他条目的CWE条目。 1161 SEI CERT C Coding Standard - Guidelines 07. Characters and Strings (STR)
成员 看法看法- a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). 1200 2019年CWE前25个最危险的软件错误中的弱点
成员 看法看法- a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). 1337 2021 CWE中的弱点前25个最危险的软件弱点
成员 看法看法- a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). 1350 2020年CWE前25个最危险的软件弱点中的弱点
成员 看法看法- a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). 1387 Weaknesses in the 2022 CWE Top 25 Most Dangerous Software Weaknesses
+分类映射
映射的分类名称 节点ID 合身 映射的节点名称
PLOVER 越野读
证书C安全编码 ARR30-C 不精确 Do not form or use out-of-bounds pointers or array subscripts
证书C安全编码 ARR38-C 不精确 确保图书馆功能不会形成无效的指针
证书C安全编码 EXP39-C 不精确 Do not access a variable through a pointer of an incompatible type
证书C安全编码 str31-c 不精确 确保字符串存储具有足够的字符数据空间和无效终结器
证书C安全编码 str32-c CWE More Abstract Do not pass a non-null-terminated character sequence to a library function that expects a string
软件故障模式 SFP8 Faulty Buffer Access
+参考
[Ref-1034] Raoul Strackx,Yves Yunan,Pieter Philippaerts,Frank Piessens,Sven Lachmund和Thomas Walter。“打破内存保密假设”。ACM。2009-03-31。<https://dl.acm.org/citation.cfm?doid = 1519144.1519145>。
[REF-1035] Fermin J. Serna. "The info leak era on software exploitation". 2012-07-25. <https://media.blackhat.com/bh-us-12/briefings/serna/bh_us_12_serna_serna_leak_era_era_slides.pdf>。
[Ref-44] Michael Howard,David Leblanc和John Viega。“软件安全性的24个致命罪”。“罪5:缓冲区超支。”第89页。McGraw-Hill。2010年。
+Content History
+提交
提交日期 提交者 组织
2006-07-19 PLOVER
+修改
修改日期 修饰符 组织
2008-09-08 CWE内容团队 MITRE
更新了适用的_platforms,关系,分类_ mappings,弱点_ordinalities
2009-10-29 CWE内容团队 MITRE
更新的描述
2010-09-27 CWE内容团队 MITRE
更新的关系
2011-06-01 CWE内容团队 MITRE
更新的common_cconsquences
2012-05-11 CWE内容团队 MITRE
更新了示范示例,参考,关系
2014-06-23 CWE内容团队 MITRE
updated Related_Attack_Patterns
2014-07-30 CWE内容团队 MITRE
更新的关系,分类_mappings
2015-12-07 CWE内容团队 MITRE
更新的关系
2017-11-08 CWE内容团队 MITRE
updated Causal_Nature, Observed_Examples, Taxonomy_Mappings
2018-03-27 CWE内容团队 MITRE
更新的描述
2019-01-03 CWE内容团队 MITRE
更新的关系
2019-06-20 CWE内容团队 MITRE
更新的描述, Related_Attack_Patterns
2019-09-19 CWE内容团队 MITRE
更新的common_cconsquences, Observed_Examples, Potential_Mitigations, References, Relationships
2020-02-24 CWE内容团队 MITRE
更新势_的限制,关系,分类_mappings
2020-06-25 CWE内容团队 MITRE
updated Observed_Examples, Potential_Mitigations
2020-08-20 CWE内容团队 MITRE
更新了观察到的examples,电位_MINEIGATIONS,关系
2020-12-10 CWE内容团队 MITRE
更新相关的_attack_patterns,关系
2021-07-20 CWE内容团队 MITRE
更新了观察到的示例,关系
2022-04-28 CWE内容团队 MITRE
更新的Research_gaps
2022-06-28 CWE内容团队 MITRE
更新了观察到的示例,关系
2022-10-13 CWE内容团队 MITRE
更新了适用的_platforms,关系,分类_mappings
2023-01-31 CWE内容团队 MITRE
更新的描述
提供更多信息 - 请选择其他过滤器。
Page Last Updated:2023年1月31日