sqlmapproject/sqlmap · error · NotImplementedError

hostExtract: an ordered comparator is required…

Error message

hostExtract: an ordered comparator is required (membership-only unsupported)

What it means

hostExtract refusal: the dialect's compare mode is pure membership (IN-style) with no ordered comparator. Binary-search extraction needs an ordering predicate, so the driver raises rather than manufacture an operator the target already rejected.

Solutions

  1. Retry discovery to find an ordered comparator (BETWEEN or operator-free rung)
  2. Use the membership-window _readNum path of the native engine instead
  3. Switch to a different injection vector that permits '>' style predicates
Defensive patterns

Strategy: fallback

When it happens

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

Appendix: source

Thrown at extra/esperanto/engine.py:103

    Returns an ExtractResult (value / exact / truncated / integrity), NOT a bare string:
    an undecided host observation degrades to a FAILED result (never a manufactured bit),
    a value longer than maxlen is flagged TRUNCATED, and a code-mode value read through an
    UNPROVEN char-code fn is whole-value verified so a lossy code fn is caught (integrity
    FAILED), exactly as the native engine does - so this stays a faithful sufficiency proof."""
    HUGE = 1 << 62

    def ask(cond):
        # STRICT tri-state, like _OracleCore._ask: only a real bool is an observation; anything
        # else (None from a transport/undecided oracle) is NOT coerced to False.
        r = oracle(cond)
        if r is True or r is False:
            return r
        raise OracleUndecided("host oracle undecided: %s" % cond)

    if strategy.compare_mode == "like" or (strategy.substring is None and strategy.length is None):
        raise NotImplementedError("hostExtract: pattern-only extraction is not driven by this reference")
    if strategy.comparator == "membership":
        raise NotImplementedError("hostExtract: an ordered comparator is required (membership-only unsupported)")

    def _run():
        if strategy.length is not None:
            L = strategy.renderLength(expr)
            if not ask(strategy.renderGt(L, -1, HUGE)):     # L >= 0: defined and non-negative
                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

View on GitHub (pinned to 0a35b20e39)