CWE-644 对HTTP头部进行脚本语法转义处理不恰当

admin 2021年11月6日14:50:58评论82 views字数 1895阅读6分19秒阅读模式

CWE-644 对HTTP头部进行脚本语法转义处理不恰当

Improper Neutralization of HTTP Headers for Scripting Syntax

结构: Simple

Abstraction: Variant

状态: Incomplete

被利用可能性: High

基本描述

The application does not neutralize or incorrectly neutralizes web scripting syntax in HTTP headers that can be used by web browser components that can process raw headers, such as Flash.

扩展描述

An attacker may be able to conduct cross-site scripting and other attacks against users who have these components enabled.

If an application does not neutralize user controlled data being placed in the header of an HTTP response coming from the server, the header may contain a script that will get executed in the client's browser context, potentially resulting in a cross site scripting vulnerability or possibly an HTTP response splitting attack. It is important to carefully control data that is being placed both in HTTP response header and in the HTTP response body to ensure that no scripting syntax is present, taking various encodings into account.

相关缺陷

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

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

适用平台

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

常见的影响

范围 影响 注释
['Integrity', 'Confidentiality', 'Availability'] Execute Unauthorized Code or Commands Run arbitrary code.
Confidentiality Read Application Data Attackers may be able to obtain sensitive information.

可能的缓解方案

Architecture and Design

策略:

Perform output validation in order to filter/escape/encode unsafe data that is being passed from the server in an HTTP response header.

Architecture and Design

策略:

Disable script execution functionality in the clients' browser.

示例代码

In the following Java example, user-controlled data is added to the HTTP headers and returned to the client. Given that the data is not subject to neutralization, a malicious user may be able to inject dangerous scripting tags that will lead to script execution in the client browser.

bad Java

response.addHeader(HEADER_NAME, untrustedRawInputData);

分析过的案例

标识 说明 链接

分类映射

映射的分类名 ImNode ID Fit Mapped Node Name
Software Fault Patterns SFP24 Tainted input to command

文章来源于互联网:scap中文网

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年11月6日14:50:58
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CWE-644 对HTTP头部进行脚本语法转义处理不恰当http://cn-sec.com/archives/613655.html

发表评论

匿名网友 填写信息