Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. sinatra
  4. ›
  5. CVE-2022-29970

CVE-2022-29970: sinatra does not validate expanded path matches

May 3, 2022 (updated November 4, 2025)

Sinatra before 2.2.0 does not validate that the expanded path matches public_dir when serving static files.

References

  • github.com/advisories/GHSA-qp49-3pvw-x4m5
  • github.com/rubysec/ruby-advisory-db/blob/master/gems/sinatra/CVE-2022-29970.yml
  • github.com/sinatra/sinatra
  • github.com/sinatra/sinatra/pull/1683
  • github.com/sinatra/sinatra/pull/1683/commits/462c3ca1db53ed3cfc394cf5948e9c948ad1c10e
  • github.com/skylightio/skylight-ruby/pull/294
  • lists.debian.org/debian-lts-announce/2022/10/msg00034.html
  • lists.debian.org/debian-lts-announce/2024/09/msg00020.html
  • nvd.nist.gov/vuln/detail/CVE-2022-29970

Code Behaviors & Features

Detect and mitigate CVE-2022-29970 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 2.2.0

Fixed versions

  • 2.2.0

Solution

Upgrade to version 2.2.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-426: Untrusted Search Path

Source file

gem/sinatra/CVE-2022-29970.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:56 +0000.