Uncontrolled Search Path Element
Weakness ID: 427 (Weakness Base)Status: Draft
+ Description

Description Summary

The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.

Extended Description

Although this weakness can occur with any type of resource, it is frequently introduced when a product uses a directory search path to find executables or code libraries, but the path contains a directory that can be modified by an attacker, such as "/tmp" or the current working directory.

+ Time of Introduction
  • Implementation
+ Applicable Platforms



+ Observed Examples
CVE-2001-0912Error during packaging causes product to include a hard-coded, non-standard directory in search path.
CVE-2001-0289Product searches current working directory for configuration file.
CVE-2005-1705Product searches current working directory for configuration file.
CVE-2005-1307Product executable other program from current working directory.
CVE-2002-2040Untrusted path.
CVE-2005-2072Modification of trusted environment variable leads to untrusted path vulnerability.
CVE-2005-1632Product searches /tmp for modules before other paths.
+ Potential Mitigations

Phase: Architecture and Design

Assume all input is malicious. Use a standard input validation mechanism to validate all input for length, type, syntax, and business rules before accepting the data to be displayed or stored. Use an "accept known good" validation strategy.

Do not rely exclusively on blacklist validation to detect malicious input or to encode output. There are too many variants to encode a character; you're likely to miss some variants.

Inputs should be decoded and canonicalized to the application's current internal representation before being validated. Make sure that your application does not decode the same input twice. Such errors could be used to bypass whitelist schemes by introducing dangerous inputs after they have been checked.

+ Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfCategoryCategory417Channel and Path Errors
Development Concepts (primary)699
ChildOfWeakness ClassWeakness Class668Exposure of Resource to Wrong Sphere
Research Concepts (primary)1000
+ Taxonomy Mappings
Mapped Taxonomy NameNode IDFitMapped Node Name
PLOVERUncontrolled Search Path Element
+ Related Attack Patterns
CAPEC-IDAttack Pattern Name
(CAPEC Version: 1.4)
38Leveraging/Manipulating Configuration File Search Paths
+ Maintenance Notes

Unlike untrusted search path (CWE-426), which inherently involves control over the definition of a control sphere, this entry concerns a fixed control sphere in which some part of the sphere may be under attacker control. This is not a clean fit under CWE-668 or CWE-610, which suggests that the control sphere model needs enhancement or clarification.

+ Content History
Submission DateSubmitterOrganizationSource
PLOVERExternally Mined
Modification DateModifierOrganizationSource
2008-07-01Eric DalciCigitalExternal
updated Potential Mitigations, Time of Introduction
2008-09-08CWE Content TeamMITREInternal
updated Relationships, Observed Example, Other Notes, Taxonomy Mappings
2009-07-27CWE Content TeamMITREInternal
updated Description, Maintenance Notes, Observed Examples, Other Notes, Potential Mitigations, Relationships