{"record":{"id":"498f8407f8b4cb0f","repo":"sqlmapproject/sqlmap","slug":"remote-s-498f84","errorCode":null,"errorMessage":"(remote) %s","messagePattern":"\\(remote\\) (.+?)","errorType":"exception","errorClass":"OperationalError","httpStatus":null,"severity":"error","filePath":"extra/dbwire/postgres.py","lineNumber":300,"sourceCode":"                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:\n        _send(sock, b\"\", struct.pack(\"!I\", _PROTOCOL_VERSION) + params)  # StartupMessage\n        _authenticate(sock, user, password)\n        while True:  # drain until ReadyForQuery (ParameterStatus/BackendKeyData/NoticeResponse)\n            mtype, payload = _read_message(sock)","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/dbwire/postgres.py#L282-L318","documentation":"Error \"(remote) %s\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at extra/dbwire/postgres.py:300 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":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}