GHSA-gvff-25cc-4f66: Restify swagger jsdoc Path Traversal Vulnerability
HIGHGHSA-gvff-25cc-4f66 is a HIGH path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Restify swagger jsdoc libraries in the npm ecosystem. The issue involves path traversal in restify-swagger-jsdoc. Remediation is available by upgrading affected packages to version 3.2.1.
GHSA-gvff-25cc-4f66 at a Glance
How to Fix GHSA-gvff-25cc-4f66
To remediate this vulnerability, upgrade all affected Restify swagger jsdoc dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install restify-swagger-jsdoc@3.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls restify-swagger-jsdoc
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-gvff-25cc-4f66, inspect your project dependencies using npm:
npm ls restify-swagger-jsdoc
Analyze the terminal output to locate any version of Restify swagger jsdoc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.1), your application is affected.
Note: The npm ls restify-swagger-jsdoc command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
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 Restify swagger jsdoc, 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
GHSA-gvff-25cc-4f66 Affected Restify swagger jsdoc Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
restify-swagger-jsdoc
|
npm |
< 3.2.1
|
3.2.1
|
References
Frequently Asked Questions
What is GHSA-gvff-25cc-4f66?
Which Restify swagger jsdoc versions are affected?
What version fixes GHSA-gvff-25cc-4f66?
Is restify-swagger-jsdoc affected?
What CWE is associated with GHSA-gvff-25cc-4f66?
How can I check npm dependencies for GHSA-gvff-25cc-4f66?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gvff-25cc-4f66",
"modified" : "2020-08-31T18:44:58Z",
"published" : "2020-09-03T17:15:56Z",
"aliases" : [ ],
"summary" : "Path Traversal in restify-swagger-jsdoc",
"details" : "Versions of `restify-swagger-jsdoc` prior to 3.2.1 are vulnerable to Path Traversal. The package fails to properly sanitize URLs, which may allow attackers to access server files outside the `swagger-ui` folder by using relative paths. \n\n\n\n## Recommendation\n\nUpgrade to version 3.2.1 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "restify-swagger-jsdoc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/1037"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:44:58Z",
"nvd_published_at" : null
}
}