GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — atlas-search + fleet-search: parse_cursor panics on malformed cursors (odd-length / non-ASCII) instead of returning 400 · Issue #7761 · developing-today/code

atlas-search + fleet-search: parse_cursor panics on malformed cursors (odd-length / non-ASCII) instead of returning 400 #7761

New issue
Copy link
New issue
Copy link
Closed
#7762
Closed
atlas-search + fleet-search: parse_cursor panics on malformed cursors (odd-length / non-ASCII) instead of returning 400#7761
#7762
Copy link
Labels
app/atlas-searchpkgs/atlas-search (Atlas search service + atlas-embed)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator job

Description

@developing-today
developing-today
bot
opened on Nov 8, 2026
Issue body actions

atlas-search + fleet-search: parse_cursor panics on malformed cursors instead of returning 400

Evidence

parse_cursor decodes the client-supplied results-paging cursor by slicing
the string at byte offsets with no length or ASCII-hex gate:

  • pkgs/atlas-search/crates/atlas-search/src/server.rs:1723-1735
  • pkgs/fleet/crates/fleet-search/src/server.rs:1723-1735 (byte-identical twin)
let bytes: Result<Vec<u8>, _> = (0..cursor.len())
    .step_by(2)
    .map(|i| u8::from_str_radix(&cursor[i..i + 2], 16))
    .collect();

The cursor arrives from the HTTP request (caller at server.rs:1632,
Some(c) => parse_cursor(c)?) in the results-paging handler. The connection
is served on a per-connection thread (server.rs:1980) with no
catch_unwind around routing, so a panic kills the thread and drops the
connection instead of producing the function's own documented
400 "malformed cursor" error.

Verified this run on the laptop at main 151c8e7e1c with a probe crate
(~/git/fleet/probe-cursor-hex, function copied verbatim, minimal
ServerError stub):

  • control: valid format_cursor(42) roundtrip → Ok(42)
  • control: even-length non-hex "zzzz" → Err(malformed cursor)
  • control: empty string → Err(malformed cursor)
  • odd-length hex (valid cursor minus its last character) → PANIC
    (slice index out of range at the final pair)
  • single character "a" → PANIC
  • hex pair prefix + multibyte input ("6162a\u{e9}") → PANIC
    (slice at a non-char-boundary byte offset)

This is the same ungated-hex-parser class as #7750 (fixed in #7757 for
local_claims::hex_bytes): the sibling parsers there carry an
is_ascii_hexdigit gate per #2517; parse_cursor in both copies has none.
u8::from_str_radix also accepts a leading +, so even where a malformed
pair does not panic it is not validated as hex before decoding.

Why it matters

Any client (or any corrupted/proxied request) that sends an odd-length or
non-ASCII cursor query value crashes its connection thread with a panic
instead of receiving the designed 400. Panics on untrusted input are a
robustness/DoS surface and produce panic noise in server logs; the cursor
is explicitly documented as opaque client-held state, so malformed values
are expected input, not an internal invariant.

Acceptance criteria

  • Both copies (atlas-search and fleet-search server.rs) refuse a
    cursor whose length is odd or that contains any non-ASCII-hexdigit
    byte, returning Err(bad_request("malformed cursor")) — no panic on
    any input, including multibyte UTF-8.
  • Valid cursors produced by format_cursor still roundtrip to the
    same offset in both copies.
  • Regression tests cover at least: odd-length hex, single character,
    multibyte/non-boundary input, even-length non-hex, and the valid
    roundtrip — in both crates (or in the crate(s) where the handler
    lives, with the twin kept byte-identical in behavior).
  • No other behavior of the results-paging handler changes (offset
    beyond end still returns its existing 400).

Activity

  1. developing-today
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    status/in-progressQueue worker lifecycle state
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    work/self-assignedAn agent grabbed this item directly, outside the queue
    app/atlas-searchpkgs/atlas-search (Atlas search service + atlas-embed)
    on Nov 8, 2026
  2. developing-today commented on Nov 8, 2026

    @developing-today
    developing-todayBot
    on Nov 8, 2026 – with developing.today
    ContributorAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane B, slug new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-08 10:20 CST
    • Found via: filed this run
    • Task: Self-solving under lifecycle protocol §4 (guarded trivial fix): gate parse_cursor on even length + ASCII hexdigits in both atlas-search and fleet-search server.rs copies, with regression tests.
    • Expectation: effort xs; done = PR merged, malformed cursors return 400 "malformed cursor" with no panic, valid cursors roundtrip.
    • Links: probe ~/git/fleet/probe-cursor-hex (laptop); branch creator-b/7761-cursor-hex-gate to follow
  3. developing-today
    added a commit that references this issue on Nov 8, 2026

    Merge pull request #7762 from developing-today/creator-b/7761-cursor-…

    469842c
  4. developing-today
    closed this as completedin #7762on Nov 8, 2026
  5. developing-today commented on Nov 8, 2026

    @developing-today
    developing-todayBot
    on Nov 8, 2026 – with developing.today
    ContributorAuthor
    More actions

    🤖 Agent note · done

    • Agent: new-issue-creator job (lane B, slug new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-08 10:20 CST
    • Found via: filed this run
    • Task: Self-solved under lifecycle protocol §4: gated parse_cursor (even length + ASCII hexdigits) in both atlas-search and fleet-search server.rs copies with regression tests.
    • Expectation: done — PR fix(search): gate parse_cursor on even length + ASCII hexdigits (#7761) #7762 merged 469842c; atlas-search test 1 passed, fleet-search (--features serve) test 1 passed on laptop; valid cursors roundtrip.
    • Links: PR fix(search): gate parse_cursor on even length + ASCII hexdigits (#7761) #7762 (merged); probe ~/git/fleet/probe-cursor-hex (laptop)
  6. developing-today
    removed
    status/in-progressQueue worker lifecycle state
    work/self-assignedAn agent grabbed this item directly, outside the queue
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/atlas-searchpkgs/atlas-search (Atlas search service + atlas-embed)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator job

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.