{"record":{"id":"c6e1ca5e68ca63a2","repo":"ruby/rubygems","slug":"attempting-to-load-unpermitted-symbol-symbol-ins","errorCode":null,"errorMessage":"Attempting to load unpermitted symbol #{symbol.inspect} @ #{stack.join(\".\")}","messagePattern":"Attempting to load unpermitted symbol #(.+?) @ #(.+?)","errorType":"exception","errorClass":"Gem::SafeMarshal::Visitors::ToRuby::UnpermittedSymbolError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/safe_marshal/visitors/to_ruby.rb","lineNumber":59,"sourceCode":"        array = register_object([])\n\n        elements = a.elements\n        size = elements.size\n        idx = 0\n        # not idiomatic, but there's a huge number of IMEMOs allocated here, so we avoid the block\n        # because this is such a hot path when doing a bundle install with the full index\n        while idx < size\n          push_stack idx\n          array << visit(elements[idx])\n          idx += 1\n        end\n\n        array\n      end\n\n      def visit_Gem_SafeMarshal_Elements_Symbol(s)\n        name = s.name\n        raise UnpermittedSymbolError.new(symbol: name, stack: formatted_stack) unless @permitted_symbols.include?(name)\n        visit_symbol_type(s)\n      end\n\n      def map_ivars(klass, ivars)\n        stack_idx = @stack_idx\n        ivars.map.with_index do |(k, v), i|\n          @stack_idx = stack_idx\n\n          push_stack \"ivar_\"\n          push_stack i\n          k = resolve_ivar(klass, k)\n\n          @stack_idx = stack_idx\n          push_stack k\n\n          next k, visit(v)\n        end\n      end","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/safe_marshal/visitors/to_ruby.rb#L41-L77","documentation":"Error \"Attempting to load unpermitted symbol #{symbol.inspect} @ #{stack.join(\".\")}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/safe_marshal/visitors/to_ruby.rb:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not install the gem: its metadata references a symbol outside the permitted set","Fetch the gem from the official source; report the tampered package if it persists"],"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"}