CWE

普遍的弱点

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

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

CWE-621:可变提取错误

弱点ID:621
Abstraction:Base
Structure:Simple
查看自定义信息:
+描述
该产品使用外部输入来确定提取信息的变量名称,而无需验证指定变量的名称是否有效。这可能导致程序覆盖意外变量。
+扩展描述

For example, in PHP, extraction can be used to provide functionality similar to register_globals, a dangerous functionality that is frequently disabled in production systems. Calling extract() or import_request_variables() without the proper arguments could allow arbitrary global variables to be overwritten, including superglobals.

Similar functionality is possible in other interpreted languages, including custom languages.

+Alternate Terms
可变覆盖
+Relationships
Section HelpThis table shows the weaknesses and high level categories that are related to this weakness. These relationships are defined as ChildOf, ParentOf, MemberOf and give insight to similar items that may exist at higher and lower levels of abstraction. In addition, relationships such as PeerOf and CanAlsoBe are defined to show similar weaknesses that the user may want to explore.
+与观点“研究概念”相关(CWE-1000)
Nature 类型 ID Name
ChildOf Base基础 - 仍然主要独立于资源或技术的弱点,但有足够的细节来提供特定的检测和预防方法。基本水平的弱点通常用以下维度的2或3来描述问题:行为,财产,技术,语言和资源。 914 Improper Control of Dynamically-Identified Variables
canpreceede Base基础 - 仍然主要独立于资源或技术的弱点,但有足够的细节来提供特定的检测和预防方法。基本水平的弱点通常用以下维度的2或3来描述问题:行为,财产,技术,语言和资源。 471 Modification of Assumed-Immutable Data (MAID)
Section HelpThis table shows the weaknesses and high level categories that are related to this weakness. These relationships are defined as ChildOf, ParentOf, MemberOf and give insight to similar items that may exist at higher and lower levels of abstraction. In addition, relationships such as PeerOf and CanAlsoBe are defined to show similar weaknesses that the user may want to explore.
+与“软件开发”视图相关(CWE-699)
Nature 类型 ID Name
成员 类别类别 - 包含共享共同特征的其他条目的CWE条目。 1006 不良的编码实践
+Modes Of Introduction
Section HelpThe 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
执行
+Applicable Platforms
Section HelpThis 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

php(Undetermined Prevalence)

+Common Consequences
Section HelpThis 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.
Scope 影响 Likelihood
正直

Technical Impact:修改应用程序数据

攻击者可以修改敏感数据或程序变量。
+示例的例子

示例1

This code uses the credentials sent in a POST request to login a user.

(bad code)
示例语言:php
//Log user in, and set $isAdmin to true if user is an administrator

功能登录($ user,$ pass){
$query = buildQuery($user,$pass);
mysql_query($ query);
if(getuserrole($ user)==“ admin”){
$isAdmin = true;
}
}

$isAdmin = false;
extract($_POST);
login(mysql_real_escape_string($user),mysql_real_escape_string($pass));

呼叫提取()将覆盖上面定义的任何变量的现有值,在这种情况下为$ isadmin。攻击者可以发送带有意外的第三值“ Isadmin”等于“ True”的邮政请求,从而获得管理特权。

+观察到的例子
参考 描述
extract issue enables file inclusion
用于寄存器的提取物兼容层,启用路径遍历
extract() buried in include files makes post-disclosure analysis confusing; original report had seemed incorrect.
extract() enables static code injection
import_request_variables()埋在include文件中,使公开后分析混淆
+潜在的缓解

阶段:实施

Strategy: Input Validation

Use allowlists of variable names that can be extracted.

阶段:实施

考虑重构代码以避免完全提取例程。

阶段:实施

In PHP, call extract() with options such as EXTR_SKIP and EXTR_PREFIX_ALL; call import_request_variables() with a prefix argument. Note that these capabilities are not present in all PHP versions.
+Weakness Ordinalities
Ordinality 描述
基本的
(弱点独立于其他弱点的地方)
+会员资格
Section HelpThis MemberOf Relationships table shows additional CWE Categories and Views that reference this weakness as a member. This information is often useful in understanding where a weakness fits within the context of external information sources.
Nature 类型 ID Name
成员 ViewView - 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). 884 CWE横截面
成员 类别类别 - 包含共享共同特征的其他条目的CWE条目。 990 SFP辅助群集:污染输入的命令
+Notes

Research Gap

Probably under-reported for PHP. Seems under-studied for other interpreted languages.
+分类映射
Mapped Taxonomy Name Node ID 合身 Mapped Node Name
Software Fault Patterns SFP24 Tainted input to command
+Content History
+提交
提交日期 Submitter 组织
2007-05-07 CWE Content Team MITRE
+Modifications
Modification Date 修饰符 组织
2008-07-01 Eric Dalci 雪茄
updated Time_of_Introduction
2008-09-08 CWE Content Team MITRE
更新的描述,关系,obsoved_example,other_notes,fealness_ordinalities
2008-10-14 CWE Content Team MITRE
updated Description
2011-06-01 CWE Content Team MITRE
更新的common_cconsquences
2012-05-11 CWE Content Team MITRE
更新的common_cconsquences,expdiveative_examples,关系
2012-10-30 CWE Content Team MITRE
更新的势_MINEIGATIONS
2013-02-21 CWE Content Team MITRE
updated Demonstrative_Examples, Relationships
2014-06-23 CWE Content Team MITRE
更新的描述,其他_notes
2014-07-30 CWE Content Team MITRE
更新的关系,分类_mappings
2020-02-24 CWE Content Team MITRE
更新的关系
2020-06-25 CWE Content Team MITRE
更新的势_MINEIGATIONS
2022-04-28 CWE Content Team MITRE
更新的Research_gaps
提供更多信息 - 请选择其他过滤器。
Page Last Updated:January 31, 2023