CVE-2022-29970 json
sinatra does not validate expanded path matches
published 2022-05-02 4 y ago modified 2026-06-17 4 mo ago also GHSA-qp49-3pvw-x4m5 , EUVD-2022-5007
- cvss
- 7.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.1%
- EPSS 2.1% chance of exploitation in 30 days, percentile 82%
- public exploits
- 0
- none known
Summary
Sinatra before 2.2.0 does not validate that the expanded path matches public_dir when serving static files.
Patch / fix
- rubygems sinatra 2.2.0
- sinatrarb sinatra 2.2.0
- ruby-sinatra Debian 14, Debian 13, Debian 12 2.2.2-1
debian advisories DEBIAN-CVE-2022-29970
- ruby-sinatra Ubuntu 22.04 LTS 2.0.8.1-2+deb11u1build0.22.04.1
- ruby-sinatra Ubuntu Pro 16.04 LTS 1.4.7-3ubuntu0.1~esm2
- ruby-sinatra Ubuntu Pro 18.04 LTS 1.4.8-1ubuntu0.1~esm2
ubuntu advisories UBUNTU-CVE-2022-29970
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- foreman satellite utils 6.12, satellite capsule 6.12, satellite 6.12 3.3.0.17-1.el8sat
- candlepin satellite 6.12 4.1.15-1.el8sat
- foreman-cli satellite utils 6.12, satellite 6.12 3.3.0.17-1.el8sat
- foreman-ec2 satellite 6.12 3.3.0.17-1.el8sat
- foreman-gce satellite 6.12 3.3.0.17-1.el8sat
- rubygem-git satellite 6.12 1.11.0-1.el8sat
- foreman-ovirt satellite 6.12 3.3.0.17-1.el8sat
- python-django satellite capsule 6.12, satellite 6.12 3.2.14-2.el8pc
red hat advisories RHSA-2022:8506RHSA-2022:4587RHSA-2022:4661RHSA-2022:2253RHSA-2022:2256RHSA-2022:2255
- rubygem-sinatra OpenStack Cloud Crowbar 8 1.4.6-3.3.1
- grafana OpenStack Cloud Crowbar 9, OpenStack Cloud 9 6.7.4-3.26.1
- python-lxml OpenStack Cloud Crowbar 9, OpenStack Cloud 9 4.2.4-3.3.1
- python-Pillow OpenStack Cloud Crowbar 9, OpenStack Cloud 9 5.2.0-3.17.1
- ardana-barbican OpenStack Cloud 9 9.0+git.1644879908.8a641c1-3.13.1
- rubygem-sinatra OpenStack Cloud Crowbar 9 1.4.6-4.3.1
- openstack-cinder OpenStack Cloud Crowbar 9, OpenStack Cloud 9 13.0.10~dev24-3.34.2
- openstack-ironic OpenStack Cloud Crowbar 9, OpenStack Cloud 9 11.1.5~dev18-3.28.2
suse advisories SUSE-SU-2022:2046-1SUSE-SU-2022:1729-1
- pcs AlmaLinux 8 0.10.12-6.el8.alma
- pcs-snmp AlmaLinux 8 0.10.12-6.el8.alma
- pcs AlmaLinux 9 0.11.1-10.el9
- pcs-snmp AlmaLinux 9 0.11.1-10.el9
almalinux advisories ALSA-2022:4661ALSA-2022:4587
- libdb Rocky Linux 8 5.3.28-42.el8_4
- pcs Rocky Linux 8 0.10.12-6.el8_6.1
rocky linux advisories RLSA-2022:8506RLSA-2022:4661
- github.com/sinatra/sinatra#1683 commit
- github.com/sinatra/sinatra#1683 pull request
- github.com/skylightio/skylight-ruby#294 pull request
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-29970 updated cvss 7.5
sinatra: path traversal possible outside of public_dir when serving static files
-
Red Hat Enterprise Linux 7 pcs, pcs-snmp, python-clufter Red Hat Satellite 6 tfm-rubygem-sinatra, tfm-rubygem-mustermann, tfm-ror51-rubygem-sinatra, tfm-ror52-rubygem-sinatra, tfm-rubygem-rack-protection, tfm-ror51-rubygem-mustermann, +3 more Red Hat Storage 3 rubygem-sinatraaffected: workaround, no fix available “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.”
-
Red Hat Enterprise Linux High Availability (v. 9) pcs 0.11.1-10.el9_0.1, pcs-snmp 0.11.1-10.el9_0.1fixed: vendor fix “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.” RHSA-2022:4587
-
Red Hat Enterprise Linux High Availability E4S (v. 8.1) pcs 0.10.2-4.el8_1.2, pcs-snmp 0.10.2-4.el8_1.2fixed: vendor fix “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.” RHSA-2022:2255
-
Red Hat Enterprise Linux High Availability EUS (v. 8.2) pcs 0.10.4-6.el8_2.2, pcs-snmp 0.10.4-6.el8_2.2fixed: vendor fix “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.” RHSA-2022:2253
-
Red Hat Enterprise Linux HighAvailability (v. 8) pcs 0.10.12-6.el8_6.1, pcs-snmp 0.10.12-6.el8_6.1fixed: vendor fix “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.” RHSA-2022:4661
-
Red Hat Enterprise Linux HighAvailability EUS (v.8.4) pcs 0.10.8-1.el8_4.1, pcs-snmp 0.10.8-1.el8_4.1fixed: vendor fix “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.” RHSA-2022:2256
-
Red Hat Enterprise Linux Resilient Storage (v. 9) pcs 0.11.1-10.el9_0.1, pcs-snmp 0.11.1-10.el9_0.1fixed: vendor fix “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.” RHSA-2022:4587
-
Red Hat Enterprise Linux Resilient Storage EUS (v. 8.2) pcs 0.10.4-6.el8_2.2, pcs-snmp 0.10.4-6.el8_2.2fixed: vendor fix “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.” RHSA-2022:2253
show 4 moreshow fewer
-
Red Hat Enterprise Linux ResilientStorage (v. 8) pcs 0.10.12-6.el8_6.1, pcs-snmp 0.10.12-6.el8_6.1fixed: vendor fix “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.” RHSA-2022:4661
-
Red Hat Enterprise Linux ResilientStorage EUS (v.8.4) pcs 0.10.8-1.el8_4.1, pcs-snmp 0.10.8-1.el8_4.1fixed: vendor fix “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.” RHSA-2022:2256
-
Red Hat Satellite 6.12 for RHEL 8 rubygem-sinatra 2.2.0-1.el8satfixed: vendor fix “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.” RHSA-2022:8506
-
Red Hat Satellite 6.12 for RHEL 8 cjson 1.7.14-5.el8sat, libdb 5.3.28-42.el8_4, katello 4.5.0-1.el8sat, libsolv 0.7.22-4.el8pc, libcomps 0.1.18-4.el8pc, python-idna 3.3-2.el8pc, +640 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
2.14% chance of exploitation in the next 30 days, higher than 82% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| rubygems | sinatra | <2.2.0 |
2.2.0 |
Classification
References
-
github.com
/sinatra/sinatra/pull/1683/commits/462c3ca1db53ed3cfc394cf5948e9c948ad1c10e
web, patch, third-party-advisory
-
github.com
/sinatra/sinatra/pull/1683
web
-
github.com
/skylightio/skylight-ruby/pull/294
web
-
lists.debian.org
/debian-lts-announce/2022/10/msg00034.html
mailing-list, web, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2024/09/msg00020.html
web
-
nvd.nist.gov
/vuln/detail/CVE-2022-29970
advisory
-
github.com
/rubysec/ruby-advisory-db/blob/master/gems/sinatra/CVE-2022-29970.yml
web
-
github.com
/sinatra/sinatra
web
Sources
- CVE List CVE-2022-29970
- GitHub Advisory GHSA-qp49-3pvw-x4m5
- NVD CVE-2022-29970
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.