sqlmapproject/sqlmap · error · OperationalError

CUBRID broker rejected the connection (status %d)

Error message

CUBRID broker rejected the connection (status %d)

What it means

Error "CUBRID broker rejected the connection (status %d)" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/dbwire/cubrid.py:277

            if self._sock is not None:
                self._sock.close()
        except Exception:
            pass
        self._sock = None

    def _recvn(self, n):
        return recvn(self._sock, n)

    def _open(self):
        # broker handshake (may redirect to a dedicated CAS worker port), then cleartext OPEN_DATABASE login
        try:
            sock = socket.create_connection((self._host, self._port), timeout=self._timeout)
            keepalive(sock)
            sock.sendall(_MAGIC + struct.pack(">BB", _CLIENT_JDBC, _CAS_VERSION) + b"\x00\x00\x00")
            self._sock = sock
            (port,) = struct.unpack(">i", self._recvn(4))
            if port < 0:
                raise OperationalError("CUBRID broker rejected the connection (status %d)" % port)
            if port > 0:  # redirected to a CAS worker: reconnect there, no second handshake
                self._safe_close()
                sock = socket.create_connection((self._host, port), timeout=self._timeout)
                keepalive(sock)
                self._sock = sock

            login = self._fixed(self._database, 32) + self._fixed(self._user, 32) + self._fixed(self._password, 32)
            login += b"\x00" * 532  # 512 extended-info + 20 reserved
            self._sock.sendall(login)
            reader = self._read_response()
            reader.int()             # response_code (>=0; errors already raised in _read_response)
            broker = reader.raw(8)
            self._protocol_version = bytearray(broker)[4] & 0x3f
            # enable auto-commit so each statement is independent (avoids the CAS keep-connection handshake dance)
            self._call(_Writer(_FC_SET_DB_PARAMETER).arg_int(_PARAM_AUTO_COMMIT).arg_int(1))
        except (socket.error, socket.timeout) as ex:
            self._safe_close()
            raise OperationalError("could not connect to '%s:%s' (%s)" % (self._host, self._port, ex))

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/dbwire/cubrid.py:277 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/ca2a0068e75608f0. Report an issue: GitHub.