{"record":{"id":"50a81cfac213f5b8","repo":"ruby/rubygems","slug":"installing-symlink-s-pointing-to-parent-path-s","errorCode":null,"errorMessage":"installing symlink '%s' pointing to parent path %s of %s is not allowed","messagePattern":"installing symlink '(.+?)' pointing to parent path (.+?) of (.+?) is not allowed","errorType":"exception","errorClass":"Gem::Package::SymlinkError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/package.rb","lineNumber":438,"sourceCode":"\n  def extract_tar_gz(io, destination_dir, pattern = \"*\") # :nodoc:\n    destination_dir = File.realpath(destination_dir)\n\n    directories = []\n    symlinks = []\n\n    open_tar_gz io do |tar|\n      tar.each do |entry|\n        full_name = entry.full_name\n        next unless File.fnmatch pattern, full_name, File::FNM_DOTMATCH\n\n        destination = install_location full_name, destination_dir\n\n        if entry.symlink?\n          link_target = entry.header.linkname\n          real_destination = link_target.start_with?(\"/\") ? link_target : File.expand_path(link_target, File.dirname(destination))\n\n          raise Gem::Package::SymlinkError.new(full_name, real_destination, destination_dir) unless\n            normalize_path(real_destination).start_with? normalize_path(destination_dir + \"/\")\n\n          symlinks << [full_name, link_target, destination, real_destination]\n        end\n\n        mkdir =\n          if entry.directory?\n            destination\n          else\n            File.dirname destination\n          end\n\n        unless directories.include?(mkdir)\n          FileUtils.mkdir_p mkdir, mode: dir_mode ? 0o755 : (entry.header.mode if entry.directory?)\n          directories << mkdir\n        end\n\n        verify_extraction_dir mkdir, destination_dir","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/package.rb#L420-L456","documentation":"Error \"installing symlink '%s' pointing to parent path %s of %s is not allowed\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/package.rb:438 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not install this package: it contains a symlink escaping the install directory","If you built the gem, remove the offending symlink and rebuild"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}