sqlmapproject/sqlmap · error · ValueError

truncated DNS name

Error message

truncated DNS name

What it means

_skipName walks a DNS name in a SRV response and hits the end of the packet before a zero terminator label. The SRV answer is truncated or corrupted, so the name cannot be skipped reliably; discovery aborts parsing that record instead of reading out of bounds.

Solutions

  1. Re-query the SRV record; the response may have been truncated (check TC flag, retry over TCP).
  2. Verify the resolver is not mangling the response.
  3. Check the offset passed to _skipName matches the start of the RDATA name field.
  4. Fall back to manual KDC configuration if DNS discovery keeps failing.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at extra/kerberos/discovery.py:93 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/e0844815716ba421. Report an issue: GitHub.

Appendix: source

Thrown at extra/kerberos/discovery.py:93

                    servers.append(parts[1])
    except (IOError, OSError):
        pass
    return servers

def _encodeName(name):
    out = bytearray()
    for label in name.split("."):
        out.append(len(label))
        out += label.encode("ascii")
    out.append(0)
    return bytes(out)

_MAX_NAME_JUMPS = 64                                       # guards against compression-pointer cycles

def _skipName(data, offset):
    while True:
        if offset >= len(data):
            raise ValueError("truncated DNS name")
        length = data[offset]
        if length == 0:
            return offset + 1
        if length & 0xc0 == 0xc0:                          # compression pointer ends the name
            if offset + 2 > len(data):
                raise ValueError("truncated DNS pointer")
            return offset + 2
        offset += 1 + length

def _readName(data, offset):
    labels = []
    end = None
    jumps = 0
    while True:
        if offset >= len(data):
            raise ValueError("truncated DNS name")
        length = data[offset]
        if length == 0:

View on GitHub (pinned to 0a35b20e39)