cve.bz

CVE-2022-29970 Path traversal

7.5 highEPSS 2.1%Fix available

High (7.5). EPSS 2.1% estimated probability of exploitation activity in the next 30 days. Fixed in sinatra 2.2.0.

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

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS
2.1% (unchanged from 2.1% a week ago; 2.1% 30 days ago) estimated probability of exploitation activity in the next 30 days; 82nd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-22 Improper Limitation of a Pathname to a Restricted Directory (Path traversal)
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-29970 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-29970?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-29970?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-29970 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
sinatrarb:sinatrabefore 2.2.0
debian:debian_linux10.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-qp49-3pvw-x4m5RubyGemssinatra<2.2.02.2.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10ruby-sinatra2.0.5-4+deb10u1DLA-3166-1
Debian11ruby-sinatra2.0.8.1-2+deb11u1DLA-3877-1
Debian12, 13, 14ruby-sinatra2.2.2-1DEBIAN-CVE-2022-29970
Ubuntu22.04:LTSruby-sinatra2.0.8.1-2+deb11u1build0.22.04.1UBUNTU-CVE-2022-29970 USN-7664-1
UbuntuPro:16.04:LTSruby-sinatra1.4.7-3ubuntu0.1~esm2UBUNTU-CVE-2022-29970 USN-7664-1
UbuntuPro:18.04:LTSruby-sinatra1.4.8-1ubuntu0.1~esm2UBUNTU-CVE-2022-29970 USN-7664-1
UbuntuPro:20.04:LTSruby-sinatra2.0.8.1-1ubuntu0.1~esm2USN-7664-1
Red Hatenterprise_linux:8::highavailability, enterprise_linux:8::resilientstoragepcs, pcs-snmp0:0.10.12-6.el8_6.1RHSA-2022:4661
Red Hatenterprise_linux:9::highavailability, enterprise_linux:9::resilientstoragepcs, pcs-snmp0:0.11.1-10.el9_0.1RHSA-2022:4587
Red Hatrhel_e4s:8.1::highavailabilitypcs, pcs-snmp0:0.10.2-4.el8_1.2RHSA-2022:2255
Red Hatrhel_eus:8.2::highavailability, rhel_eus:8.2::resilientstoragepcs, pcs-snmp0:0.10.4-6.el8_2.2RHSA-2022:2253
Red Hatrhel_eus:8.4::highavailability, rhel_eus:8.4::resilientstoragepcs, pcs-snmp0:0.10.8-1.el8_4.1RHSA-2022:2256
Red Hatsatellite:6.12::el8candlepin, candlepin-selinux0:4.1.15-1.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8foreman, foreman-cli, foreman-ec2 and 11 more0:3.3.0.17-1.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8rubygem-git0:1.11.0-1.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8rubygem-rails-html-sanitizer0:1.4.3-2.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8, satellite_capsule:6.12::el8python-django, python39-django0:3.2.14-2.el8pcRHSA-2022:8506
Red Hatsatellite:6.12::el8, satellite_capsule:6.12::el8rubygem-nokogiri, rubygem-nokogiri-debuginfo, rubygem-nokogiri-debugsource0:1.13.8-1.el8satRHSA-2022:8506
Red Hatsatellite:6.12::el8, satellite_capsule:6.12::el8rubygem-sinatra1:2.2.0-1.el8satRHSA-2022:8506
2 more for Red Hat in the JSON and on Red Hat's page.
SUSEOpenStack Cloud 9ardana-barbican9.0+git.1644879908.8a641c1-3.13.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-barbican7.0.1~dev24-3.35.2SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-cinder13.0.10~dev24-3.38.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-designate7.0.2~dev2-3.35.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-glance17.0.1~dev30-3.33.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-heat11.0.4~dev4-3.35.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-horizon14.1.1~dev11-4.39.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-ironic11.1.5~dev18-4.33.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-keystone14.2.1~dev9-3.36.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-magnum7.2.1~dev1-4.35.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-manila7.4.2~dev60-3.41.1SUSE-SU-2022:1729-1
SUSEOpenStack Cloud 9venv-openstack-monasca2.7.1~dev10-3.37.1SUSE-SU-2022:1729-1
21 more for SUSE in the JSON and on SUSE's page.
AlmaLinux8pcs, pcs-snmp0.10.12-6.el8.almaALSA-2022:4661
AlmaLinux9pcs, pcs-snmp0.11.1-10.el9ALSA-2022:4587
Rocky Linux8libdb0:5.3.28-42.el8_4RLSA-2022:8506
Rocky Linux8pcs0:0.10.12-6.el8_6.1RLSA-2022:4661

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE.

Red Hat

Red Hat rates this Important.

Red Hat's mitigation

Disable the static option which will disable the public_dir option. With this configuration, Sinatra will not serve files from the public directory and therefore files outside of it.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8pcs-0:0.10.12-6.el8_6.1Fixed 2022-05-18RHSA-2022:4661
Red Hat Enterprise Linux 8.1 Update Services for SAP Solutionspcs-0:0.10.2-4.el8_1.2Fixed 2022-05-16RHSA-2022:2255
Red Hat Enterprise Linux 8.2 Extended Update Supportpcs-0:0.10.4-6.el8_2.2Fixed 2022-05-16RHSA-2022:2253
Red Hat Enterprise Linux 8.4 Extended Update Supportpcs-0:0.10.8-1.el8_4.1Fixed 2022-05-16RHSA-2022:2256
Red Hat Enterprise Linux 9pcs-0:0.11.1-10.el9_0.1Fixed 2022-05-18RHSA-2022:4587
Red Hat Satellite 6.12 for RHEL 8rubygem-sinatra-1:2.2.0-1.el8satFixed 2022-11-16RHSA-2022:8506
Red Hat Enterprise Linux 7pcsAffected
Red Hat Satellite 6tfm-ror51-rubygem-mustermannAffected
Red Hat Satellite 6tfm-ror51-rubygem-rack-protectionAffected
Red Hat Satellite 6tfm-ror51-rubygem-sinatraAffected
Red Hat Satellite 6tfm-ror52-rubygem-mustermannAffected
Red Hat Satellite 6tfm-ror52-rubygem-rack-protectionAffected
Red Hat Satellite 6tfm-ror52-rubygem-sinatraAffected
Red Hat Satellite 6tfm-rubygem-mustermannAffected
Red Hat Satellite 6tfm-rubygem-rack-protectionAffected
Red Hat Satellite 6tfm-rubygem-sinatraAffected
Red Hat Storage 3rubygem-sinatraAffected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2022-29970.

Attack patterns (CAPEC)

  • CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic Likelihood: High · Severity: High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-78 Using Escaped Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-79 Using Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-126 Path Traversal Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON