{"record":{"id":"c9a456d6517b1b62","repo":"sqlmapproject/sqlmap","slug":"too-many-dns-compression-jumps","errorCode":null,"errorMessage":"too many DNS compression jumps","messagePattern":"too many DNS compression jumps","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"extra/kerberos/discovery.py","lineNumber":119,"sourceCode":"        offset += 1 + length\n\ndef _readName(data, offset):\n    labels = []\n    end = None\n    jumps = 0\n    while True:\n        if offset >= len(data):\n            raise ValueError(\"truncated DNS name\")\n        length = data[offset]\n        if length == 0:\n            offset += 1\n            break\n        if length & 0xc0 == 0xc0:                          # follow compression pointer (bounded, cycle-safe)\n            if offset + 2 > len(data):\n                raise ValueError(\"truncated DNS pointer\")\n            jumps += 1\n            if jumps > _MAX_NAME_JUMPS:\n                raise ValueError(\"too many DNS compression jumps\")\n            if end is None:\n                end = offset + 2\n            offset = ((length & 0x3f) << 8) | data[offset + 1]\n            continue\n        if offset + 1 + length > len(data):\n            raise ValueError(\"truncated DNS label\")\n        labels.append(bytes(data[offset + 1:offset + 1 + length]).decode(\"ascii\", \"replace\"))\n        offset += 1 + length\n    return \".\".join(labels), (end if end is not None else offset)\n\ndef parseSrv(response):\n    \"\"\"Parse SRV records from a (possibly hostile) DNS response into [(priority, weight, port,\n    target), ...]. Malformed input yields an empty list rather than raising.\"\"\"\n\n    data = bytearray(response)\n    if len(data) < 12:\n        return []\n    try:","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/kerberos/discovery.py#L101-L137","documentation":"_readName followed more compression pointers than _MAX_NAME_JUMPS (64) allows. A well-formed DNS name cannot need that many jumps; the count guards against compression-pointer cycles in crafted responses that would otherwise loop forever.","triggerScenarios":"Thrown at extra/kerberos/discovery.py:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat the response as malicious/corrupt and discard it; re-query the record.","Verify the DNS server is the intended one (a spoofed response may contain cyclic pointers).","Do not simply raise the limit — the bound exists to stop infinite loops.","Log the raw packet for analysis and fail discovery gracefully."],"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"}