{"record":{"id":"a7bd9daf2c1b9a43","repo":"sqlmapproject/sqlmap","slug":"unsupported-authentication-request-d","errorCode":null,"errorMessage":"unsupported authentication request %d","messagePattern":"unsupported authentication request (.+?)","errorType":"exception","errorClass":"InterfaceError","httpStatus":null,"severity":"error","filePath":"extra/dbwire/postgres.py","lineNumber":296,"sourceCode":"            # stored credentials, so comparing it is what makes the exchange mutual (RFC 5802 5, 5.1).\n            if salted is None or auth_message is None:\n                raise OperationalError(\"unexpected SCRAM server-final message\")\n            try:\n                attrs = dict(kv.split(\"=\", 1) for kv in payload[4:].decode(\"ascii\").split(\",\"))\n            except (ValueError, UnicodeDecodeError) as ex:\n                raise OperationalError(\"malformed SCRAM server-final message (%s)\" % ex)\n            if \"e\" in attrs:\n                raise OperationalError(\"SCRAM authentication failed (%s)\" % attrs[\"e\"])\n            try:\n                signature = base64.b64decode(attrs[\"v\"])\n            except (KeyError, binascii.Error, ValueError) as ex:\n                raise OperationalError(\"malformed SCRAM server signature (%s)\" % ex)\n            server_key = hmac.new(salted, b\"Server Key\", hashlib.sha256).digest()\n            expected = hmac.new(server_key, auth_message.encode(\"ascii\"), hashlib.sha256).digest()\n            if not hmac.compare_digest(signature, expected):\n                raise OperationalError(\"SCRAM server signature mismatch (rogue server?)\")\n        else:\n            raise InterfaceError(\"unsupported authentication request %d\" % code)\n\ndef _raise_server_error_as_operational(payload):\n    message, _ = _error_message(payload)\n    raise OperationalError(\"(remote) %s\" % message)\n\ndef connect(host=None, port=5432, user=None, password=None, database=None, connect_timeout=None, **kwargs):\n    try:\n        sock = socket.create_connection((host or \"localhost\", int(port or 5432)), timeout=connect_timeout)\n        keepalive(sock)\n    except (socket.error, socket.timeout) as ex:\n        raise OperationalError(\"could not connect to '%s:%s' (%s)\" % (host, port, ex))\n\n    params = b\"\"\n    for key, value in ((\"user\", user or \"\"), (\"database\", database or user or \"\"), (\"client_encoding\", \"UTF8\")):\n        params += key.encode(\"ascii\") + b\"\\x00\" + (\"%s\" % value).encode(\"utf-8\") + b\"\\x00\"\n    params += b\"\\x00\"\n\n    try:","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/dbwire/postgres.py#L278-L314","documentation":"The AuthenticationOk message requested an auth code this client does not implement (anything beyond trust/cleartext/md5/SASL-SCRAM, e.g. GSS, SSPI, certificate auth). The state machine refuses unknown codes instead of hanging.","triggerScenarios":"Thrown at extra/dbwire/postgres.py:296 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set pg_hba.conf to use md5 or scram-sha-256 for this client","Implement the requested auth method or use a full driver (psycopg2)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}