{"record":{"id":"6a572e8837c8735c","repo":"sqlmapproject/sqlmap","slug":"kdc-reply-length-d-exceeds-the-sane-maximum","errorCode":null,"errorMessage":"KDC reply length %d exceeds the sane maximum","messagePattern":"KDC reply length (.+?) exceeds the sane maximum","errorType":"exception","errorClass":"KerberosError","httpStatus":null,"severity":"error","filePath":"extra/kerberos/client.py","lineNumber":158,"sourceCode":"    return der.sequence(*parts)\n\n# ---- KDC transport (RFC 4120 section 7.2.2: 4-byte length-prefixed over TCP) ----------------------\ndef _recvExactly(sock, count):\n    buf = b\"\"\n    while len(buf) < count:\n        chunk = sock.recv(count - len(buf))\n        if not chunk:\n            raise KerberosError(-1, \"connection closed by KDC\")\n        buf += chunk\n    return buf\n\ndef _sendReceive(host, port, request):\n    sock = socket.create_connection((host, port), timeout=KDC_TIMEOUT)\n    try:\n        sock.sendall(struct.pack(\">I\", len(request)) + request)\n        length = struct.unpack(\">I\", _recvExactly(sock, 4))[0]\n        if length > MAX_KDC_RESPONSE:\n            raise KerberosError(-1, \"KDC reply length %d exceeds the sane maximum\" % length)\n        return _recvExactly(sock, length)\n    finally:\n        sock.close()\n\ndef _raiseIfError(message):\n    tag, content, _ = der.peel(message)\n    if tag == der.applicationTag(KRB_ERROR):\n        fields = _fields(der.peel(content)[1])\n        raise KerberosError(_expInteger(fields[6]) if 6 in fields else -1,\n                            _expString(fields[11]) if 11 in fields else None)\n    return tag, content\n\ndef _etypeHints(methodData):\n    \"\"\"Parse a METHOD-DATA TLV (SEQUENCE OF PA-DATA) into PA-ETYPE-INFO2 hints as\n    {etype: (salt, iterations)}, telling us which etype/salt/s2kparams the KDC expects for the\n    long-term key. The first entry for an etype wins; a malformed hint yields none (so the caller\n    falls back to its defaults) rather than raising.\"\"\"\n","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/kerberos/client.py#L140-L176","documentation":"Error \"KDC reply length %d exceeds the sane maximum\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at extra/kerberos/client.py:158 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"}