sqlmapproject/sqlmap · error · H2ProtocolError

peer advertised an invalid maximum frame size

Error message

peer advertised an invalid maximum frame size

What it means

Guard in _header_frames (via _send_headers) defending against a malformed SETTINGS exchange: the peer's advertised SETTINGS_MAX_FRAME_SIZE is outside the protocol-permitted 16384..16777215 range, so outgoing HEADER/CONTINUATION frames cannot be sized. Points at the peer or intermediary, not local configuration.

Solutions

  1. Reset/replace the connection with a conformant peer
  2. Verify no middlebox is mangling the HTTP/2 preface
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/request/http2.py:774 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/e16741c69aecd3c1. Report an issue: GitHub.

Appendix: source

Thrown at lib/request/http2.py:774

    _validate_pseudo_value(":authority", authority)
    if method == b"CONNECT":
        request = [(b":method", method), (b":authority", authority)]
    else:
        if not path:
            raise H2ProtocolError("non-CONNECT requests require a non-empty :path")
        _validate_pseudo_value(":path", path)
        request = [(b":method", method), (b":scheme", b"https"), (b":path", path), (b":authority", authority)]
    request.extend(_normalize_request_headers(headers, body))
    return request


def _field_section_size(headers):
    return sum(32 + len(name) + len(value) for name, value in headers)


def _header_frames(stream_id, block, max_frame_size, end_stream):
    if max_frame_size < DEFAULT_MAX_FRAME_SIZE:
        raise H2ProtocolError("peer advertised an invalid maximum frame size")
    if not block:
        return [encode_frame(HEADERS, FLAG_END_HEADERS | (FLAG_END_STREAM if end_stream else 0), stream_id, b"")]
    frames = []
    pos = 0
    first = True
    while pos < len(block):
        chunk = block[pos:pos + max_frame_size]
        pos += len(chunk)
        final = pos == len(block)
        if first:
            flags = (FLAG_END_STREAM if end_stream else 0) | (FLAG_END_HEADERS if final else 0)
            frames.append(encode_frame(HEADERS, flags, stream_id, chunk))
            first = False
        else:
            flags = FLAG_END_HEADERS if final else 0
            frames.append(encode_frame(CONTINUATION, flags, stream_id, chunk))
    return frames

View on GitHub (pinned to 0a35b20e39)