{"record":{"id":"651d11d79bef57a9","repo":"ruby/rubygems","slug":"security-device-verification-failed-response-me","errorCode":null,"errorMessage":"Security device verification failed: #{response.message}","messagePattern":"Security device verification failed: #(.+?)","errorType":"http","errorClass":"Gem::WebauthnVerificationError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/gemcutter_utilities/webauthn_poller.rb","lineNumber":49,"sourceCode":"      @host = host\n    end\n\n    def self.poll_thread(options, host, webauthn_url, credentials)\n      Thread.new do\n        thread = Thread.current\n        thread.abort_on_exception = true\n        thread.report_on_exception = false\n        thread[:otp] = new(options, host).poll_for_otp(webauthn_url, credentials)\n      rescue Gem::WebauthnVerificationError, Gem::Timeout::Error => e\n        thread[:error] = e\n      end\n    end\n\n    def poll_for_otp(webauthn_url, credentials)\n      Gem::Timeout.timeout(TIMEOUT_IN_SECONDS) do\n        loop do\n          response = webauthn_verification_poll_response(webauthn_url, credentials)\n          raise Gem::WebauthnVerificationError, response.message unless response.is_a?(Gem::Net::HTTPSuccess)\n\n          require \"json\"\n          parsed_response = JSON.parse(response.body)\n          case parsed_response[\"status\"]\n          when \"pending\"\n            sleep 5\n          when \"success\"\n            return parsed_response[\"code\"]\n          else\n            raise Gem::WebauthnVerificationError, parsed_response.fetch(\"message\", \"Invalid response from server\")\n          end\n        end\n      end\n    end\n\n    private\n\n    def webauthn_verification_poll_response(webauthn_url, credentials)","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/gemcutter_utilities/webauthn_poller.rb#L31-L67","documentation":"Error \"Security device verification failed: #{response.message}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/gemcutter_utilities/webauthn_poller.rb:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}