CWE-22 / WEAKNESS
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
A pathname escapes the directory boundary intended by the application.
- Category
- CWE weaknesses
- Version / scope
- MITRE CWE live reference; snapshot 2026-11-18
- Affected / relevant technologies
- File services / Web applications
- Evidence
- Documentation: editorial summary; publisher link access checked. Execution: not tested. Editorial: curated reference.
Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.
Mechanism and prerequisites
External input influences file selection without effective path confinement.
Potential impact
Unauthorized file reads or writes.
Detection and investigation
- Review canonical path resolution, symlink handling and access to out-of-scope files.
Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.
Mitigation and response
- Use indirect resource identifiers and enforce confinement after canonicalization; restrict filesystem privileges.
Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.
Related technical context
Publisher weakness and attack-pattern relationships
These relationships retain the publisher's source attributes and view context; they do not establish that an attack or weakness applies to a particular system.
- CAPEC-126 → Related_Weakness → CWE-22 Open related reference
- CAPEC-64 → Related_Weakness → CWE-22 Open related reference
- CAPEC-76 → Related_Weakness → CWE-22 Open related reference
- CAPEC-78 → Related_Weakness → CWE-22 Open related reference
- CAPEC-79 → Related_Weakness → CWE-22 Open related reference
- CWE-172 → CanPrecede → CWE-22 Open related reference
- CWE-20 → CanPrecede → CWE-22 Open related reference
- CWE-22 → Related_Attack_Pattern → CAPEC-126 Open related reference
- CWE-22 → Related_Attack_Pattern → CAPEC-64 Open related reference
- CWE-22 → Related_Attack_Pattern → CAPEC-76 Open related reference
- CWE-22 → Related_Attack_Pattern → CAPEC-78 Open related reference
- CWE-22 → Related_Attack_Pattern → CAPEC-79 Open related reference
- CWE-22 → CanPrecede → CWE-668 Open related reference
- CWE-22 → ChildOf → CWE-706 Open related reference
- CWE-22 → ChildOf → CWE-706 Open related reference
- CWE-23 → ChildOf → CWE-22 Open related reference
- CWE-23 → ChildOf → CWE-22 Open related reference
- CWE-23 → ChildOf → CWE-22 Open related reference
- CWE-36 → ChildOf → CWE-22 Open related reference
- CWE-36 → ChildOf → CWE-22 Open related reference
- CWE-36 → ChildOf → CWE-22 Open related reference
- CWE-73 → CanPrecede → CWE-22 Open related reference
Authoritative sources and attribution
Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Summaries are original editorial explanations. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.
- CWE - CWE-22: Improper Limitation of a Pathname to a Restricted Directory (5.0) — source accessed 2026-11-18
Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.
