CAPEC-48: Passing Local Filenames to Functions That Expect a URL

Standard Draft 严重程度: High 攻击可能性: High

CAPEC版本: 3.9

更新日期: 2023-01-24

攻击模式描述

This attack relies on client side code to access local files and resources instead of URLs. When the client browser is expecting a URL string, but instead receives a request for a local file, that execution is likely to occur in the browser process space with the browser's authority to local files. The attacker can send the results of this request to the local files out to a site that they control. This attack may be used to steal sensitive authentication data (either local or remote), or to gain system profile information to launch further attacks.

执行流程

步骤 1 Explore

[Identify web application URL inputs] Review application inputs to find those that are designed to be URLs.

技术:
  • Manually navigate web site pages to identify URLs.
  • Use automated tools to identify URLs.
步骤 2 Experiment

[Identify URL inputs allowing local access.] Execute test local commands via each URL input to determine which are successful.

技术:
  • Manually execute a local command (such as 'pwd') via the URL inputs.
  • Using an automated tool, test each URL input for weakness.
步骤 3 Exploit

[Execute malicious commands] Using the identified URL inputs that allow local command execution, execute malicious commands.

技术:
  • Execute local commands via the URL input.

前提条件

  • The victim's software must not differentiate between the location and type of reference passed the client software, e.g. browser

所需技能

Medium Attacker identifies known local files to exploit

后果影响

影响范围: Confidentiality

技术影响: Read Data

影响范围: Integrity

技术影响: Modify Data

缓解措施

Implementation: Ensure all content that is delivered to client is sanitized against an acceptable content specification.

Implementation: Ensure all configuration files and resource are either removed or protected when promoting code into production.

Design: Use browser technologies that do not allow client side scripting.

Implementation: Perform input validation for all remote content.

Implementation: Perform output validation for all remote content.

Implementation: Disable scripting languages such as JavaScript in browser

关键信息

CAPEC ID: CAPEC-48

抽象级别: Standard

状态: Draft

典型严重程度: High

攻击可能性: High

相关攻击模式
相关CWE弱点