GHSA-q324-q795-2q5p: @redocly/openapi cli Path Traversal Vulnerability

LOW
Published
Advisory Summary

GHSA-q324-q795-2q5p is a LOW path traversal vulnerability (General Security Weakness) affecting @redocly/openapi cli libraries in the npm ecosystem. The issue involves path traversal when using `preview-docs` when working dir contains files with question mark `?` in name. Remediation is available by upgrading affected packages to version 1.0.0-beta.59.

GHSA-q324-q795-2q5p at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-q324-q795-2q5p
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product @redocly/openapi cli
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-q324-q795-2q5p

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

@redocly/openapi-cli fixed: 1.0.0-beta.59
npm install @redocly/openapi-cli@1.0.0-beta.59
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 @redocly/openapi-cli

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-q324-q795-2q5p, inspect your project dependencies using npm:

npm ls @redocly/openapi-cli

Analyze the terminal output to locate any version of @redocly/openapi cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0-beta.59), your application is affected.

Note: The npm ls @redocly/openapi-cli 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 General Security Weakness. In @redocly/openapi cli, 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

### Impact `preview-docs` command allows path traversal if current working dir contains files with question mark `?` in name and attacker knows the name. ### Patches It was patched starting from 1.0.0-beta.59 ### Workarounds Do not run openapi-cli preview-docs command in the folder which contains files with question mark `?` in name. ### References https://github.com/Redocly/openapi-cli/pull/347 ### For more information If you have any questions or comments about this advisory: * Open an issue in [@redocly/openapi-cli](https://github.com/Redocly/openapi-cli) * Email us at [security@redocly.com](mailto:security@redocly.com)

GHSA-q324-q795-2q5p Affected @redocly/openapi cli Versions

1 component(s)
Fixed Versions:
1.0.0-beta.59
Product / Package Ecosystem Affected Versions Fixed Version
@redocly/openapi-cli
npm
< 1.0.0-beta.59
1.0.0-beta.59

References

Frequently Asked Questions

What is GHSA-q324-q795-2q5p?
GHSA-q324-q795-2q5p is a security vulnerability in @redocly/openapi cli involving Path traversal when using `preview-docs` when working dir contains files with question mark `?` in name under General Security Weakness.
Which @redocly/openapi cli versions are affected?
Affected versions include releases prior to 1.0.0-beta.59 across affected packages: @redocly/openapi-cli.
What version fixes GHSA-q324-q795-2q5p?
Upgrading to 1.0.0-beta.59 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @redocly/openapi-cli affected?
Yes, @redocly/openapi-cli is affected in releases prior to 1.0.0-beta.59. Upgrade your dependency to 1.0.0-beta.59 or later.
What CWE is associated with GHSA-q324-q795-2q5p?
GHSA-q324-q795-2q5p is classified under General Security Weakness.
How can I check npm dependencies for GHSA-q324-q795-2q5p?
Run the dependency tree command: 'npm ls @redocly/openapi-cli'. 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-q324-q795-2q5p",
  "modified" : "2021-10-11T18:40:44Z",
  "published" : "2021-10-12T16:05:11Z",
  "aliases" : [ ],
  "summary" : "Path traversal when using `preview-docs` when working dir contains files with question mark `?` in name",
  "details" : "### Impact\n`preview-docs` command allows path traversal if current working dir contains files with question mark `?` in name and attacker knows the name.\n\n### Patches\nIt was patched starting from 1.0.0-beta.59\n\n### Workarounds\nDo not run openapi-cli preview-docs command in the folder which contains files with question mark `?` in name.\n\n### References\nhttps://github.com/Redocly/openapi-cli/pull/347\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [@redocly/openapi-cli](https://github.com/Redocly/openapi-cli)\n* Email us at [security@redocly.com](mailto:security@redocly.com)\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@redocly/openapi-cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.0-beta.59"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.0-beta.58"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Redocly/openapi-cli/security/advisories/GHSA-q324-q795-2q5p"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Redocly/openapi-cli/pull/347"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Redocly/openapi-cli"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-10-11T18:40:44Z",
    "nvd_published_at" : null
  }
}