CAPEC-38 Leveraging/Manipulating Configuration File Search Paths

CAPEC ID: 38

CAPEC-38 Metadata

Likelihood of Attack

High

Typical Severity

Very High

Overview

Summary

This pattern of attack sees an adversary load a malicious resource into a program's standard path so that when a known command is executed then the system instead executes the malicious component. The adversary can either modify the search path a program uses, like a PATH variable or classpath, or they can manipulate resources on the path to point to their malicious components. J2EE applications and other component based applications that are built from multiple binaries can have very long list of dependencies to execute. If one of these libraries and/or references is controllable by the attacker then application controls can be circumvented by the attacker.

Prerequisites

The attacker must be able to write to redirect search paths on the victim host.

Potential Solutions / Mitigations

Design: Enforce principle of least privilege Design: Ensure that the program's compound parts, including all system dependencies, classpath, path, and so on, are secured to the same or higher level assurance as the program Implementation: Host integrity monitoring

Related Weaknesses (CWE)

CWE ID Description
CWE-426 Untrusted Search Path
CWE-427 Uncontrolled Search Path Element

Related CAPECs

CAPEC ID Description
CAPEC-159 An adversary exploits a weakness in the way an application searches for external libraries to manipulate the execution flow to point to an adversary supplied library or code base. This pattern of attack allows the adversary to compromise the application or server via the execution of unauthorized code. An application typically makes calls to functions that are a part of libraries external to the application. These libraries may be part of the operating system or they may be third party libraries. If an adversary can redirect an application's attempts to access these libraries to other libraries that the adversary supplies, the adversary will be able to force the targeted application to execute arbitrary code. This is especially dangerous if the targeted application has enhanced privileges. Access can be redirected through a number of techniques, including the use of symbolic links, search path modification, and relative path manipulation.

Taxonomy Mappings

Taxonomy: ATTACK

Entry ID Entry Name
1574.007 Hijack Execution Flow: Path Interception by PATH Environment Variable
1574.009 Hijack Execution Flow: Path Interception by Unquoted Path

Stay Ahead of Attack Patterns

Understanding CAPEC patterns helps security professionals anticipate and thwart potential attacks. Leverage these insights to enhance threat modeling, strengthen your software development lifecycle, and train your security teams effectively.