Hiroshi SHIBATA 2026-08-03 02:38:39 +0000 (Mon, 03 Aug 2026)
New Revision: aeb7a05799
https://github.com/ruby/ruby/commit/aeb7a05799
Log:
[ruby/rubygems] Check the resolved parent directory before extracting old format gems
Gem::Package::Old#extract_files only validated entry paths by string
expansion, so a preexisting symlink in the extraction directory redirected
writes outside of it. Gem::Package#extract_tar_gz already re-resolves the
parent directory with File.realpath, so extract the shared check into
verify_extraction_dir and call it from both.
https://github.com/ruby/rubygems/commit/20e729f9a5
Co-Authored-By: Claude Opus 5 <
nor...@anthropic.com>
Modified files:
lib/rubygems/package.rb
lib/rubygems/package/old.rb
test/rubygems/test_gem_package_old.rb