sqlmapproject/sqlmap · error · InterfaceError
TDS message exceeds the maximum allowed length (%d bytes)
Error message
TDS message exceeds the maximum allowed length (%d bytes)
What it means
Error "TDS message exceeds the maximum allowed length (%d bytes)" thrown in sqlmapproject/sqlmap.
Source
Thrown at extra/dbwire/tds.py:77
raise connection_lost(ex)
packet_id += 1
if last:
break
def _read_message(sock):
# reassemble a full TDS message across packets (EOM status bit marks the last). The packet length is a
# 16-bit field, so bounding IT against _MAX_MESSAGE_LENGTH can never trigger - a hostile peer simply
# never sets EOM and streams packets forever. Bound the accumulated message instead, and collect the
# chunks in a list so reassembly stays linear rather than re-copying a growing immutable buffer.
chunks, total = [], 0
while True:
header = recvn(sock, 8)
mtype, status, length = struct.unpack(">BBH", header[:4])
if length < 8:
raise InterfaceError("invalid TDS packet length (%d)" % length)
total += length - 8
if total > _MAX_MESSAGE_LENGTH:
raise InterfaceError("TDS message exceeds the maximum allowed length (%d bytes)" % _MAX_MESSAGE_LENGTH)
chunks.append(recvn(sock, length - 8))
if status & _STATUS_EOM:
break
return b"".join(chunks)
# ---- PRELOGIN ----------------------------------------------------------------------------------------
def _prelogin(sock):
ver = struct.pack(">IH", 0x11000000, 0)
enc = b"\x02" # ENCRYPT_NOT_SUP
tokens = b"\x00" + struct.pack(">HH", 11, len(ver))
tokens += b"\x01" + struct.pack(">HH", 11 + len(ver), len(enc))
tokens += b"\xff"
_send_message(sock, _PKT_PRELOGIN, tokens + ver + enc)
body = _read_message(sock)
off = 0
while off < len(body) and _u8(body, off) != 0xff:
token = _u8(body, off)View on GitHub (pinned to 0a35b20e39)
When it happens
Trigger: Thrown at extra/dbwire/tds.py:77 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/58e95be8d8c70521.
Report an issue: GitHub.