CVE-2023-38337 rswag vulnerable to arbitrary JSON and YAML file read via directory traversal

High 7.5 Published Updated

Remote attackers can read arbitrary JSON and YAML files via directory traversal in the rswag Ruby library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-38337?

CVE-2023-38337 is a high-severity path traversal vulnerability in n/a, published on 14 Jul 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

rswag before 2.10.1 allows remote attackers to read arbitrary JSON and YAML files via directory traversal, because rswag-api can expose a file that is not the OpenAPI (or Swagger) specification file of a project.

Weakness: CWE-22

Which versions are affected by CVE-2023-38337?

2 open source packages ship an affected version, including rswag. It affects 1 product.

PackageAffectedFixed in
rswag RubyGemsAll versions2.10.1
rswag RubyGemsAll versions2.10.1

Products include Rswag Project Rswag.

How do I fix CVE-2023-38337?

Upgrade rswag to 2.10.1 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2023-38337 being exploited?

There is no known exploitation of CVE-2023-38337 in the wild and no public exploit code.

Sources

Also known as GHSA-vc79-65pr-q82v.

Is CVE-2023-38337 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free