CWE-22: Improper Limitation of a Pathname to a Restricted Directory
Official CWE-22 CWE context with Glexia analysis, remediation guidance, related CVEs, and ATT&CK context.
Glexia's Take
CWE-22: Path Traversal
Improper Limitation of a Pathname to a Restricted Directory represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Executive Impact
- Sensitive file disclosure
- Unauthorized overwrite
- Configuration leakage
Developer Pattern
CWE-22 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.
Confidence
medium confidence from CWE-22, starter-2026-05.
Official CWE Definition
CWE-22: Improper Limitation of a Pathname to a Restricted Directory
Path Traversal is a software weakness pattern tracked by CWE 22. The local starter record is replaced by the official MITRE CWE import when the sync pipeline runs.
Path Traversal is a software weakness pattern tracked by CWE 22. The local starter record is replaced by the official MITRE CWE import when the sync pipeline runs.
Developer And Remediation Guidance
How teams prevent and detect this weakness
Causes
- Using ../ sequences from a request path to read files.
Remediation
- Canonicalize paths
- Restrict to approved roots
- Use object IDs instead of paths
- Reject traversal sequences
Detection
- DAST
- SAST
- Filesystem access tests
Mappings
Related CVEs, CWEs, and ATT&CK context
Related CWEs
No related CWE relationships are published yet.
ATT&CK Relevance
ATT&CK relevance is shown only when reviewed or responsibly inferred.