CVE-2020-15230: Github.com/vapor/vapor Remote Code Execution Vulnerability
MODERATECVE-2020-15230 is a MODERATE (CVSS 6.5) remote code execution vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/vapor/vapor libraries in the SwiftURL ecosystem. The issue involves arbitrary file read using percent-encoded relative paths in filemiddleware. Remediation is available by upgrading affected packages to version 4.29.4.
CVE-2020-15230 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2020-15230
To remediate this vulnerability, upgrade all affected Github.com/vapor/vapor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/vapor/vapor to 4.29.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/vapor/vapor
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-15230, inspect your project dependencies for Github.com/vapor/vapor:
inspect dependencies for github.com/vapor/vapor
Analyze the terminal output to locate any version of Github.com/vapor/vapor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.29.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Github.com/vapor/vapor, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-15230 Affected Github.com/vapor/vapor Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/vapor/vapor
|
SwiftURL |
≥ 4.0.0-rc.2.5
< 4.29.4
|
4.29.4
|
References
Frequently Asked Questions
What is CVE-2020-15230?
Which Github.com/vapor/vapor versions are affected?
What version fixes CVE-2020-15230?
Is github.com/vapor/vapor affected?
What is the CVSS score of CVE-2020-15230?
What CWE is associated with CVE-2020-15230?
How can I check SwiftURL dependencies for CVE-2020-15230?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vcvg-xgr8-p5gq",
"modified" : "2023-06-09T19:31:32Z",
"published" : "2023-06-09T19:31:32Z",
"aliases" : [ "CVE-2020-15230" ],
"summary" : "Arbitrary file read using percent-encoded relative paths in FileMiddleware",
"details" : "### Impact\n\nAttackers can access data at arbitrary filesystem paths on the same host as an application using `FileMiddleware`.\n\n### Patches\n\nVersion [4.29.4](https://github.com/vapor/vapor/releases/tag/4.29.4)\n\n### Workarounds\n\nUpgrade to 4.24.4 or later, or disable `FileMiddleware`.\n\n### References\n\n* Introduced in https://github.com/vapor/vapor/pull/2223\n* Fixed by https://github.com/vapor/vapor/pull/2500\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open [an issue](https://github.com/vapor/vapor/issues)\n* Email us at [security@vapor.codes](mailto:security@vapor.codes)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "SwiftURL",
"name" : "github.com/vapor/vapor"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0-rc.2.5"
}, {
"fixed" : "4.29.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/vapor/vapor/security/advisories/GHSA-vcvg-xgr8-p5gq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15230"
}, {
"type" : "WEB",
"url" : "https://github.com/vapor/vapor/pull/2500"
}, {
"type" : "WEB",
"url" : "https://github.com/vapor/vapor/commit/cf1651f7ff76515593f4d8ca6e6e15d2247fe255"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/vapor/vapor"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-06-09T19:31:32Z",
"nvd_published_at" : "2020-10-02T19:15:00Z"
}
}