CVE-2023-40165
HIGHDescription
rubygems.org is the Ruby community's primary gem (library) hosting service. Insufficient input validation allowed malicious actors to replace any uploaded gem version that had a platform, version number, or gem name matching `/-\d/`, permanently replacing the legitimate upload in the canonical gem storage bucket, and triggering an immediate CDN purge so that the malicious gem would be served immediately. The maintainers have checked all gems matching the `/-\d/` pattern and can confirm that no unexpected `.gem`s were found. As a result, we believe this vulnerability was _not_ exploited. The easiest way to ensure that a user's applications were not exploited by this vulnerability is to check that all of your downloaded .gems have a checksum that matches the checksum recorded in the RubyGems.org database. RubyGems contributor Maciej Mensfeld wrote a tool to automatically check that all downloaded .gem files match the checksums recorded in the RubyGems.org database. You can use it by running: `bundle add bundler-integrity` followed by `bundle exec bundler-integrity`. Neither this tool nor anything else can prove you were not exploited, but the can assist your investigation by quickly comparing RubyGems API-provided checksums with the checksums of files on your disk. The issue has been patched with improved input validation and the changes are live. No action is required on the part of the user. Users are advised to validate their local gems.
How to fix
Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.
CVSS v3 Vector
Exploitability
Impact
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N
Exploit Intelligence
Low risk: more likely to be exploited than 31% of all known CVEs.
References
Related Vulnerabilities
Other CWE-20 (Improper Input Validation) vulnerabilities, ordered by exploit likelihood. View all
| CVE | Severity | CVSS | EPSS | Exploited | Fix |
|---|---|---|---|---|---|
| CVE-2024-3400 | Critical | 10.0 | 100% | KEV + Ransom | - |
| CVE-2021-45105 | Medium | 5.9 | 100% | - | Fix |
| CVE-2021-44228 | Critical | 10.0 | 100% | KEV + Ransom | Fix |
| CVE-2021-21985 | Critical | 9.8 | 100% | KEV + Ransom | Fix |
| CVE-2018-7600 | Critical | 9.8 | 100% | KEV + Ransom | Fix |
| CVE-2020-3452 | High | 7.5 | 100% | KEV | Fix |
Embed a live status badge for CVE-2023-40165
Markdown
[](https://tridentstack.com/cve/CVE-2023-40165)HTML
<a href="https://tridentstack.com/cve/CVE-2023-40165"><img src="https://tridentstack.com/cve/badge/CVE-2023-40165.svg" alt="CVE-2023-40165"></a>Find and fix vulnerabilities across your fleet
TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.
Start freeThis product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2024-11-21.