Hiroshi SHIBATA 145a4bba92 [ruby/rubygems] Validate gem name before building compact index cache paths
Bundler::CompactIndexClient::Cache#info_path and #info_etag_path join
the gem name into the cache directory without validation. The name comes
from the remote index, either versions lines or transitive dependency
names in info files, so a crafted name like "../../../../pwn" escapes
the cache directory because the special-characters branch keeps the raw
name and only appends an MD5 suffix. Reject any name that is not a plain
basename before constructing the path, matching the fetch_spec guard
from https://github.com/ruby/rubygems/commit/56ed326cb2, and apply the same guard to the independent
Gem::CompactIndexClient::Cache port.

https://github.com/ruby/rubygems/commit/4b1c454526

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-30 05:42:06 +00:00
..
2026-07-29 11:03:30 -04:00