CWE-646 依赖于外部提供文件的文件名或扩展名

admin 2021年11月6日14:50:57评论134 views字数 1747阅读5分49秒阅读模式

CWE-646 依赖于外部提供文件的文件名或扩展名

Reliance on File Name or Extension of Externally-Supplied File

结构: Simple

Abstraction: Variant

状态: Incomplete

被利用可能性: High

基本描述

The software allows a file to be uploaded, but it relies on the file name or extension of the file to determine the appropriate behaviors. This could be used by attackers to cause the file to be misclassified and processed in a dangerous fashion.

扩展描述

An application might use the file name or extension of of a user-supplied file to determine the proper course of action, such as selecting the correct process to which control should be passed, deciding what data should be made available, or what resources should be allocated. If the attacker can cause the code to misclassify the supplied file, then the wrong action could occur. For example, an attacker could supply a file that ends in a ".php.gif" extension that appears to be a GIF image, but would be processed as PHP code. In extreme cases, code execution is possible, but the attacker could also cause exhaustion of resources, denial of service, exposure of debug or system data (including application source code), or being bound to a particular server side process. This weakness may be due to a vulnerability in any of the technologies used by the web and application servers, due to misconfiguration, or resultant from another flaw in the application itself.

相关缺陷

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

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

适用平台

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

常见的影响

范围 影响 注释
Confidentiality Read Application Data An attacker may be able to read sensitive data.
Availability DoS: Crash, Exit, or Restart An attacker may be able to cause a denial of service.
Access Control Gain Privileges or Assume Identity An attacker may be able to gain privileges.

可能的缓解方案

Architecture and Design

策略:

Make decisions on the server side based on file content and not on file name or extension.

相关攻击模式

  • CAPEC-209

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

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年11月6日14:50:57
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CWE-646 依赖于外部提供文件的文件名或扩展名http://cn-sec.com/archives/613654.html

发表评论

匿名网友 填写信息