Path Traversal Vulnerability in @redocly/openapi-cli

@redocly/openapi-cli Updated 02 Oct 2025

Summary

12/10/2021
LOW
Yes i
Low
Not published

GHSA-q324-q795-2q5p: Path traversal when using preview-docs when working dir contains files with question mark ? in name. Affects @redocly/openapi-cli versions < 1.0.0-beta.59. Fixed in 1.0.0-beta.59. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The @redocly/openapi-cli package is an open-source tool used for working with OpenAPI specifications. It provides various commands and functionalities to validate, lint, and preview OpenAPI documents. This package is widely used by developers and organizations to ensure the quality and consistency of their API documentation.

Vulnerability Detail

A path traversal vulnerability has been identified in the preview-docs command of the @redocly/openapi-cli package. This vulnerability allows an attacker to perform path traversal attacks if the current working directory contains files with a question mark '?' in their name. By exploiting this vulnerability, an attacker can access sensitive files outside of the intended directory, potentially leading to unauthorized access, information disclosure, or remote code execution.

How To Fix

Minimum fixed version

1.0.0-beta.59

This is the first release that contains the fix.

npm install @redocly/openapi-cli@1.0.0-beta.59

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you are unable to immediately update the @redocly/openapi-cli package, a temporary workaround is to avoid running the preview-docs command in a folder that contains files with a question mark '?' in their name. By ensuring that the working directory does not include such files, you can mitigate the risk of path traversal attacks.

Conclusion

The path traversal vulnerability in @redocly/openapi-cli can have serious security implications, allowing attackers to access sensitive files outside of the intended directory. It is crucial to update to the patched version or apply the recommended workaround to mitigate the risk. For further support and assistance in vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for @redocly/openapi-cli →

Share this vulnerability

FAQ

The path traversal vulnerability in @redocly/openapi-cli allows an attacker to access sensitive files outside of the intended directory. This can lead to unauthorized access, information disclosure, or remote code execution depending on the specific circumstances.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. The playground analyzes your package-lock.json file and provides real-time alerts for open-source vulnerabilities, including this path traversal vulnerability in @redocly/openapi-cli.

Yes, a temporary workaround is to avoid running the preview-docs command in a folder that contains files with a question mark '?' in their name. By ensuring that the working directory does not include such files, you can mitigate the risk of path traversal attacks.

Yes, the path traversal vulnerability in @redocly/openapi-cli has been patched starting from version 1.0.0-beta.59. It is recommended to update to this version or later to ensure the security of your application.

You can find more information about this vulnerability in the GitHub advisory at https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/10/GHSA-q324-q795-2q5p/GHSA-q324-q795-2q5p.json. If you have any further questions or concerns, you can open an issue in the @redocly/openapi-cli repository or email security@redocly.com.

How To Fix

Minimum fixed version

1.0.0-beta.59

This is the first release that contains the fix.

npm install @redocly/openapi-cli@1.0.0-beta.59

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback