sqlmapproject/sqlmap · error · OracleUndecided

host length failed final equality

Error message

host length failed final equality

What it means

Error "host length failed final equality" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/esperanto/engine.py:127

                is_null = ask(strategy.renderIsNull(expr))  # ask ONCE (a noisy oracle could disagree twice)
                return ExtractResult(None, is_null=is_null, complete=is_null)
            if maxlen <= 0:                                 # non-empty but capped to nothing
                return ExtractResult("", complete=False, truncated=True)
            if not ask(strategy.renderGt(L, 0, HUGE)):      # not L > 0 -> empty string
                return ExtractResult("", complete=True)
            lo, hi = 1, min(8, maxlen)
            while hi < maxlen and ask(strategy.renderGt(L, hi, HUGE)):
                lo, hi = hi + 1, min(hi * 2, maxlen)
            while lo < hi:
                mid = (lo + hi) // 2
                lo, hi = (mid + 1, hi) if ask(strategy.renderGt(L, mid, HUGE)) else (lo, mid)
            length = lo
            truncated = length >= maxlen and ask(strategy.renderGt(L, maxlen, HUGE))   # a char past the cap
            # FINAL EQUALITY (as the native integer reader does): the comparator is proven only on
            # literals; a backend that rewrites '>' to '>=' for a computed operand (LENGTH(..)>n)
            # converges off-by-one. Confirm the length directly, else fail closed.
            if not truncated and not ask("(%s)=%d" % (L, length)):
                raise OracleUndecided("host length failed final equality")
        else:                                               # no length fn: derive from substring end
            exists = lambda n: ask(strategy.renderCharExists(expr, n))
            if not exists(1):
                is_null = ask(strategy.renderIsNull(expr))  # ask ONCE
                return ExtractResult(None, is_null=is_null, complete=is_null)
            if maxlen <= 0:                                 # non-empty but capped to nothing
                return ExtractResult("", complete=False, truncated=True)
            lo, hi = 1, min(8, maxlen)
            while hi < maxlen and exists(hi):
                lo, hi = hi, min(hi * 2, maxlen)
            while lo < hi:
                mid = (lo + hi + 1) // 2
                lo, hi = (mid, hi) if exists(mid) else (lo, mid - 1)
            length = lo
            truncated = length >= maxlen and exists(maxlen + 1)

        def read(pos):
            mode = strategy.compare_mode

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/esperanto/engine.py:127 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/fd0557e69eed9cb7. Report an issue: GitHub.