CWE-300 通道可被非端点访问(中间人攻击)

Channel Accessible by Non-Endpoint ('Man-in-the-Middle')

结构: Simple

Abstraction: Class

状态: Draft

被利用可能性: unkown

基本描述

The product does not adequately verify the identity of actors at both ends of a communication channel, or does not adequately ensure the integrity of the channel, in a way that allows the channel to be accessed or influenced by an actor that is not an endpoint.

扩展描述

In order to establish secure communication between two parties, it is often important to adequately verify the identity of entities at each end of the communication channel. Inadequate or inconsistent verification may result in insufficient or incorrect identification of either communicating entity. This can have negative consequences such as misplaced trust in the entity at the other end of the channel. An attacker can leverage this by interposing between the communicating entities and masquerading as the original entity. In the absence of sufficient verification of identity, such an attacker can eavesdrop and potentially modify the communication between the original entities.

相关缺陷

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

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

适用平台

Language: {'cwe_Class': 'Language-Independent', 'cwe_Prevalence': 'Undetermined'}

常见的影响

范围 影响 注释
['Confidentiality', 'Integrity', 'Access Control'] ['Read Application Data', 'Modify Application Data', 'Gain Privileges or Assume Identity'] An attacker could pose as one of the entities and read or possibly modify the communication.

可能的缓解方案

Implementation

策略:

Always fully authenticate both ends of any communications channel.

Architecture and Design

策略:

Adhere to the principle of complete mediation.

Implementation

策略:

A certificate binds an identity to a cryptographic key to authenticate a communicating party. Often, the certificate takes the encrypted form of the hash of the identity of the subject, the public key, and information such as time of issue or expiration using the issuer's private key. The certificate can be validated by deciphering the certificate with the issuer's public key. See also X.509 certificate signature chains and the PGP certification structure.

示例代码

In the Java snippet below, data is sent over an unencrypted channel to a remote server.

bad Java

Socket sock;
PrintWriter out;

try {
sock = new Socket(REMOTE_HOST, REMOTE_PORT);
out = new PrintWriter(echoSocket.getOutputStream(), true);

// Write data to remote host via socket output stream.
...
}

By eavesdropping on the communication channel or posing as the endpoint, an attacker would be able to read all of the transmitted data.

分析过的案例

标识 说明 链接

Notes

分类映射

映射的分类名 ImNode ID Fit Mapped Node Name
PLOVER Man-in-the-middle (MITM)
WASC 32 Routing Detour
The CERT Oracle Secure Coding Standard for Java (2011) SEC06-J Do not rely on the default automatic signature verification provided by URLClassLoader and java.util.jar

相关攻击模式

  • CAPEC-117
  • CAPEC-466
  • CAPEC-57
  • CAPEC-589
  • CAPEC-590
  • CAPEC-612
  • CAPEC-613
  • CAPEC-615
  • CAPEC-94

引用