CVE-2020-15230: Arbitrary file read using percent-encoded relative paths in FileMiddleware
6.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.67549%
CWE
Published
6/9/2023
Updated
6/19/2023
KEV Status
No
Technology
Swift
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
github.com/vapor/vapor | swift | >= 4.0.0-rc.2.5, < 4.29.4 | 4.29.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from the order of operations in path processing. The original implementation: 1. Took the raw URL path (still percent-encoded) 2. Trimmed leading slashes 3. Later applied percent-decoding when constructing the filesystem path. This allowed attackers to submit paths like '%2e%2e/secret' which would pass the initial 'relative path' check (appearing as non-slash-prefixed), then decode to '../secret' when accessing the filesystem. The patch fixed this by percent-decoding before path
validation()
, ensuring security checks see the actual path characters.