Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-105221 Overview
The gist RubyGem before version 6.1.0 disables TLS certificate verification when communicating with the GitHub API. The http_connection method in lib/gist.rb sets OpenSSL::SSL::VERIFY_NONE, which instructs the client to accept any certificate presented by the server. On-path attackers can intercept HTTPS traffic between the gist client and GitHub by presenting an arbitrary certificate. Successful interception exposes OAuth tokens and login credentials used to authenticate against GitHub. Attackers who capture these credentials can read and modify the victim's gists. The weakness is classified under CWE-295: Improper Certificate Validation.
Critical Impact
On-path attackers can decrypt and modify GitHub API traffic to steal OAuth tokens and hijack victim accounts.
Affected Products
- gist RubyGem versions prior to 6.1.0
- Ruby applications and CLI workflows using the gist client to publish to GitHub
- CI/CD pipelines and developer workstations invoking the gist tool with authenticated tokens
Discovery Timeline
- 2026-10-04 - CVE-2026-105221 published to the National Vulnerability Database (NVD)
- 2026-10-06 - Last updated in NVD database
Technical Details for CVE-2026-105221
Vulnerability Analysis
The gist RubyGem provides a command-line and library interface for creating and managing GitHub gists over the GitHub REST API. All API calls traverse HTTPS and rely on Transport Layer Security (TLS) to protect credentials and payloads. The vulnerable client builds its HTTPS connection using Ruby's Net::HTTP and explicitly disables peer certificate validation. The result is a connection that negotiates TLS but accepts any presented certificate, including self-signed or attacker-controlled certificates. Because the GitHub API requires an Authorization header carrying an OAuth token or basic credentials, every request made by an exploited user leaks those secrets to any on-path interceptor.
Root Cause
The root cause is a hardcoded assignment of connection.verify_mode = OpenSSL::SSL::VERIFY_NONE inside the http_connection method in lib/gist.rb. This setting overrides the secure default of VERIFY_PEER and prevents OpenSSL from validating the server certificate chain, expiration, and hostname. The patch at commit 07ccc1a6d46e9d36f0e85d0b1c5d795890ae6bcf replaces the constant with OpenSSL::SSL::VERIFY_PEER so the client enforces the standard trust chain.
Attack Vector
Exploitation requires an attacker positioned on the network path between the victim and api.github.com. Hostile Wi-Fi hotspots, compromised routers, rogue proxies, and malicious egress controls in shared infrastructure all qualify. The attacker presents any valid-looking TLS certificate during the handshake, decrypts the request, extracts the Authorization header, and either forwards or rewrites the response. Captured OAuth tokens can then be replayed against the GitHub API to read, modify, or delete the victim's gists.
# Vulnerable code in lib/gist.rb (prior to 6.1.0)
if uri.scheme == "https"
connection.use_ssl = true
connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
# Patched code (6.1.0 and later)
if uri.scheme == "https"
connection.use_ssl = true
connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
end
# Source: https://github.com/defunkt/gist/commit/07ccc1a6d46e9d36f0e85d0b1c5d795890ae6bcf
Detection Methods for CVE-2026-105221
Indicators of Compromise
- Unexpected gists created, modified, or deleted on developer accounts without user action
- GitHub audit log entries showing API access from unfamiliar IP addresses or user agents
- TLS sessions to api.github.com terminating at intermediate hosts rather than GitHub's edge
- Presence of vulnerable gist gem versions (less than 6.1.0) in Gemfile.lock or gem list output
Detection Strategies
- Inventory Ruby dependencies across developer workstations and CI runners for gist versions below 6.1.0.
- Correlate outbound TLS connections to GitHub endpoints with the issuing certificate authority and alert on non-GitHub chains.
- Use software composition analysis (SCA) tooling to flag the vulnerable gem in build pipelines before deployment.
Monitoring Recommendations
- Enable GitHub organization audit logging and review gist events for anomalous creation and update patterns.
- Monitor process execution of ruby or gist CLI binaries alongside outbound connections to validate expected destinations.
- Alert on any OAuth token usage from geolocations or ASNs that do not match the token owner's historical pattern.
How to Mitigate CVE-2026-105221
Immediate Actions Required
- Upgrade the gist gem to version 6.1.0 or later on every system where it is installed.
- Rotate any GitHub OAuth tokens, personal access tokens, or credentials used with the vulnerable client, especially on shared or untrusted networks.
- Audit each affected user's gists for unauthorized changes and restore known-good content as needed.
Patch Information
The fix is published in gist 6.1.0 via commit 07ccc1a6d46e9d36f0e85d0b1c5d795890ae6bcf, which switches connection.verify_mode from VERIFY_NONE to VERIFY_PEER in lib/gist.rb. Review the upstream commit, the issue tracker discussion, and the VulnCheck advisory for full remediation context.
Workarounds
- Restrict use of the vulnerable gist client to networks you fully control until upgrading is possible.
- Scope GitHub tokens used with the client to the minimum required permissions, avoiding broad repo or admin scopes.
- Route gist traffic through an authenticated egress proxy that enforces certificate pinning against GitHub's certificate chain.
# Upgrade the vulnerable gem on affected hosts
gem update gist --version '>= 6.1.0'
# Verify the installed version
gem list gist
# Pin a safe version in your Gemfile
# gem 'gist', '>= 6.1.0'
bundle update gist
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

