{"schemaVersion":3,"id":"CVE-2021-28966","aliases":["ALPINE-CVE-2021-28966","GHSA-46f2-3v63-3xrp","BIT-ruby-2021-28966","BIT-ruby-min-2021-28966"],"status":"published","duplicateOf":null,"title":null,"description":"In Ruby through 3.0 on Windows, a remote attacker can submit a crafted path when a Web application handles a parameter with TmpDir.","dates":{"published":"2021-07-27T16:01:12.000Z","modified":"2024-08-03T21:55:12.239Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7.5,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"OSV · Alpine","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","exploitability":10,"impact":6,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Rubygems","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","exploitability":10,"impact":6,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":5,"severity":"medium","vector":"AV:N/AC:L/Au:N/C:N/I:P/A:N","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.58039,"percentile":0.99085,"severity":"critical","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0.9059999999999957,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.57133},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.58039,"percentile":0.99085}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.57133,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.58039,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.58039,"percentile":0.99085}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"REF_1CF964CA7E3412D3","name":"Exploit Reference (hackerone.com)","source":"reference","url":"https://hackerone.com/reports/1131465","maturity":"unknown","reliabilityScore":0.2,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')","description":"The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.","type":"weakness","status":"Stable","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/22.html"}],"affected":[{"vendor":"alpine","product":"ruby","name":"ruby","label":"ruby","ecosystem":"Alpine Linux","cpePart":null,"purl":"pkg:apk/alpine/ruby","purlType":"apk","versions":[{"text":"≥ 3.0.0, < 2.5.9-r0","noFixRecorded":false,"fixedIn":null},{"text":"≥ 3.0.0, < 2.6.7-r0","noFixRecorded":false,"fixedIn":null},{"text":"≥ 3.0.0, < 2.7.3-r0","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 3.0.0, < 2.5.9-r0 | ≥ 3.0.0, < 2.6.7-r0 | ≥ 3.0.0, < 2.7.3-r0","eol":null,"hubHref":null},{"vendor":"RubyGems","product":"tmpdir","name":"tmpdir","label":"tmpdir","ecosystem":"RubyGems","cpePart":null,"purl":"pkg:gem/tmpdir","purlType":"gem","versions":[{"text":"< 0.1.2","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 0.1.2","eol":null,"hubHref":null},{"vendor":"ruby-lang","product":"ruby","name":"ruby","label":"ruby","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 2.7.3","noFixRecorded":false,"fixedIn":null},{"text":"≥ 3.0.0, < 3.0.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.7.3 | ≥ 3.0.0, < 3.0.1","eol":{"isEol":null,"eolDate":null,"matchMethod":"cpe","cycle":null,"product":{"name":"ruby","label":"Ruby","category":"lang"}},"hubHref":"/vendor/ruby-lang/ruby"}],"affectedCount":3,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://hackerone.com/reports/1131465","label":"hackerone.com/reports/1131465","hostname":"hackerone.com","tags":["X Refsource MISC","WEB","Exploit","Issue Tracking","Patch","Third Party Advisory"]},{"url":"https://security.netapp.com/advisory/ntap-20210902-0004/","label":"security.netapp.com/advisory/ntap-20210902-0004/","hostname":"security.netapp.com","tags":["X Refsource CONFIRM","Third Party Advisory"]},{"url":"https://security.alpinelinux.org/vuln/CVE-2021-28966","label":"security.alpinelinux.org/vuln/CVE-2021-28966","hostname":"security.alpinelinux.org","tags":["Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28966","label":"nvd.nist.gov/vuln/detail/CVE-2021-28966","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/ruby/tmpdir/pull/8","label":"github.com/ruby/tmpdir/pull/8","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/ruby/tmpdir/commit/93798c01cb7c10476e50a4d80130a329ba47f348","label":"github.com/ruby/tmpdir/commit/93798c01cb7c10476e50a4d80130a329ba47f348","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/ruby/tmpdir","label":"github.com/ruby/tmpdir","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/tmpdir/CVE-2021-28966.yml","label":"github.com/rubysec/ruby-advisory-db/blob/master/gems/tmpdir/CVE-2021-28966.yml","hostname":"github.com","tags":["WEB"]},{"url":"https://rubygems.org/gems/tmpdir","label":"rubygems.org/gems/tmpdir","hostname":"rubygems.org","tags":["WEB"]},{"url":"https://security.netapp.com/advisory/ntap-20210902-0004","label":"security.netapp.com/advisory/ntap-20210902-0004","hostname":"security.netapp.com","tags":["WEB"]},{"url":"https://www.ruby-lang.org/en/news/2021/04/05/tempfile-path-traversal-on-windows-cve-2021-28966","label":"www.ruby-lang.org/en/news/2021/04/05/tempfile-path-traversal-on-windows-cve-2021-28966","hostname":"www.ruby-lang.org","tags":["WEB"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2021-07-27T16:01:12.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-03T21:55:12.239Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":52,"level":"high","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T17:26:21.119Z","stale":false,"partial":false}}