CWE-15 系统设置或配置在外部可控制

External Control of System or Configuration Setting

结构: Simple

Abstraction: Base

状态: Incomplete

被利用可能性: unkown

基本描述

One or more system settings or configuration elements can be externally controlled by a user.

扩展描述

Allowing external control of system settings can disrupt service or cause an application to behave in unexpected, and potentially malicious ways.

相关缺陷

  • cwe_Nature: ChildOf cwe_CWE_ID: 642 cwe_View_ID: 1000 cwe_Ordinal: Primary

  • cwe_Nature: ChildOf cwe_CWE_ID: 642 cwe_View_ID: 699 cwe_Ordinal: Primary

  • cwe_Nature: ChildOf cwe_CWE_ID: 610 cwe_View_ID: 1000

  • cwe_Nature: ChildOf cwe_CWE_ID: 20 cwe_View_ID: 700 cwe_Ordinal: Primary

常见的影响

范围 影响 注释
Other Varies by Context

可能的缓解方案

MIT-46 Architecture and Design

策略: Separation of Privilege

Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design and that the compartmentalization serves to allow for and further reinforce privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide when it is appropriate to use and to drop system privileges.

['Implementation', 'Architecture and Design']

策略:

Because setting manipulation covers a diverse set of functions, any attempt at illustrating it will inevitably be incomplete. Rather than searching for a tight-knit relationship between the functions addressed in the setting manipulation category, take a step back and consider the sorts of system values that an attacker should not be allowed to control.

['Implementation', 'Architecture and Design']

策略:

In general, do not allow user-provided or otherwise untrusted data to control sensitive values. The leverage that an attacker gains by controlling these values is not always immediately obvious, but do not underestimate the creativity of the attacker.

示例代码

The following C code accepts a number as one of its command line parameters and sets it as the host ID of the current machine.

bad C

...
sethostid(argv[1]);
...

Although a process must be privileged to successfully invoke sethostid(), unprivileged users may be able to invoke the program. The code in this example allows user input to directly control the value of a system setting. If an attacker provides a malicious value for host ID, the attacker can misidentify the affected machine on the network or cause other unintended behavior.

The following Java code snippet reads a string from an HttpServletRequest and sets it as the active catalog for a database Connection.

bad Java

...
conn.setCatalog(request.getParameter("catalog"));
...

In this example, an attacker could cause an error by providing a nonexistent catalog name or connect to an unauthorized portion of the database.

分类映射

映射的分类名 ImNode ID Fit Mapped Node Name
7 Pernicious Kingdoms Setting Manipulation
Software Fault Patterns SFP25 Tainted input to variable

相关攻击模式

  • CAPEC-13
  • CAPEC-146
  • CAPEC-176
  • CAPEC-203
  • CAPEC-270
  • CAPEC-271
  • CAPEC-69
  • CAPEC-76
  • CAPEC-77