GHSA-4x7w-frcq-v4m3: @wturyn/swagger injector Path Traversal Vulnerability

CRITICAL
CWE-22
Published
Advisory Summary

GHSA-4x7w-frcq-v4m3 is a CRITICAL path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting @wturyn/swagger injector libraries in the npm ecosystem. The issue involves path traversal in @wturyn/swagger-injector. Remediation is available in the latest vendor maintenance releases.

GHSA-4x7w-frcq-v4m3 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-4x7w-frcq-v4m3
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product @wturyn/swagger injector
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-4x7w-frcq-v4m3

To remediate this vulnerability, upgrade all affected @wturyn/swagger injector dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@wturyn/swagger-injector fixed: Latest secure release
npm install @wturyn/swagger-injector@Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @wturyn/swagger-injector

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-4x7w-frcq-v4m3, inspect your project dependencies using npm:

npm ls @wturyn/swagger-injector

Analyze the terminal output to locate any version of @wturyn/swagger injector in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The npm ls @wturyn/swagger-injector 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 @wturyn/swagger injector, 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

All versions of `@wturyn/swagger-injector` are vulnerable to Path Traversal. The package fails to sanitize URLs, allowing attackers to access server files outside of the configured `dist` folder using relative paths. ## Recommendation No fix is currently available. Consider using an alternative package until a fix is made available.

GHSA-4x7w-frcq-v4m3 Affected @wturyn/swagger injector Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
@wturyn/swagger-injector
npm
≥ 0.0.0

References

Frequently Asked Questions

What is GHSA-4x7w-frcq-v4m3?
GHSA-4x7w-frcq-v4m3 is a security vulnerability in @wturyn/swagger injector involving Path Traversal in @wturyn/swagger-injector under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which @wturyn/swagger injector versions are affected?
Affected versions include releases prior to current release patches across affected packages: @wturyn/swagger-injector.
What version fixes GHSA-4x7w-frcq-v4m3?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is @wturyn/swagger-injector affected?
Yes, @wturyn/swagger-injector is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-4x7w-frcq-v4m3?
GHSA-4x7w-frcq-v4m3 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check npm dependencies for GHSA-4x7w-frcq-v4m3?
Run the dependency tree command: 'npm ls @wturyn/swagger-injector'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4x7w-frcq-v4m3",
  "modified" : "2020-08-31T18:49:56Z",
  "published" : "2020-09-03T20:38:47Z",
  "aliases" : [ ],
  "summary" : "Path Traversal in @wturyn/swagger-injector",
  "details" : "All versions of `@wturyn/swagger-injector` are vulnerable to Path Traversal. The package fails to sanitize URLs, allowing attackers to access server files outside of the configured `dist` folder using relative paths.\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative package until a fix is made available.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@wturyn/swagger-injector"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1173"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:49:56Z",
    "nvd_published_at" : null
  }
}