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 — id(local_claims): hex_bytes is the one pkgs/id hex parser the #2517 gate missed — it panics on misaligned multi-byte input and accepts '+'-pair spellings · Issue #7750 · developing-today/code

id(local_claims): hex_bytes is the one pkgs/id hex parser the #2517 gate missed — it panics on misaligned multi-byte input and accepts '+'-pair spellings #7750

New issue
Copy link
New issue
Copy link
Closed
#7757
Closed
id(local_claims): hex_bytes is the one pkgs/id hex parser the #2517 gate missed — it panics on misaligned multi-byte input and accepts '+'-pair spellings#7750
#7757
Copy link
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus/in-progressQueue worker lifecycle statestatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testswork/self-assignedAn agent grabbed this item directly, outside the queue

Description

@dezren39
dezren39
opened on Nov 8, 2026
Issue body actions

Summary

pkgs/id/src/local_claims.rs's private hex_bytes (lines 247–257) is the one hex parser in pkgs/id that the #2517/#3457 hardening missed: it has no ASCII-hexdigit gate and decodes by slicing &text[index..index + 2] at byte offsets. Two consequences, both verified this run on main 4af4ee8354:

  1. Panic instead of the designed error. A local-claims.jsonl line whose id/author/subject field has even byte length but contains a multi-byte character at a misaligned offset panics with byte index 2 is not a char boundary instead of returning the function's "{text:?} is not hex" error. LocalClaims::open (local_claims.rs:69–97) is explicitly built to turn a malformed line into an InvalidData io error naming the file and line number; the panic escapes that handling and crashes the caller (LocalEvents open at local_events.rs:233) on a corrupt/hand-edited/sync-mangled claims file.
  2. Non-canonical + spellings accepted. u8::from_str_radix accepts a leading +, so "+a" decodes as 0x0a — exactly the dual-spelling problem id(directory/auth): hex_to_array and hex_bytes accept '+'-encoded pairs — the same key/signature has two spellings, and a signed request's replay-guard id can be re-encoded #2517 fixed in directory.rs::hex_to_array and directory_auth.rs::hex_bytes, and that invites/invitation.rs::parse_hex32 and seitan/derive.rs::InviteId::from_hex also gate against. Every sibling parser gates on bytes().all(|b| b.is_ascii_hexdigit()) first; this one does not.

Evidence

  • pkgs/id/src/local_claims.rs:247-257 — ungated slicing decoder (only guard is an even-length check).
  • Sibling gates for comparison: pkgs/id/src/directory.rs:2597-2610, pkgs/id/src/directory_auth.rs:370-385, pkgs/id/src/invites/invitation.rs:124-135, pkgs/id/src/seitan/derive.rs:66-76.
  • Probe (laptop, ~/git/fleet/probe-localclaims-hex, exact copy of the function, main 4af4ee8354):
    • hex_bytes(&"0a".repeat(32)) → Ok([10, …]) (control)
    • hex_bytes(&"zz".repeat(32)) → Err("… is not hex") (control)
    • hex_bytes(&"+a".repeat(32)) → Ok([10, …]) (non-canonical spelling accepted)
    • hex_bytes("€a") (4 bytes, even) → PANIC end byte index 2 is not a char boundary; it is inside '€' (bytes 0..3)

Why it matters

The claims file is on-disk state read at open time; robustness there is the difference between a named, line-numbered error and an unexplained crash. The missing gate is also a consistency hole in a hardening pass (#2517/#3457) that was supposed to cover the repo's hex decoders.

Acceptance criteria

  • hex_bytes in local_claims.rs refuses any input containing a non-ASCII-hexdigit byte (including +-pairs) with the existing is not hex error, mirroring the id(directory/auth): hex_to_array and hex_bytes accept '+'-encoded pairs — the same key/signature has two spellings, and a signed request's replay-guard id can be re-encoded #2517 sibling gates.
  • No input to hash_from_hex/author_from_hex can panic: decoding works on bytes (e.g. as_bytes().chunks(2) + from_utf8) or is fully gated before slicing.
  • New unit tests in local_claims.rs cover: a +-pair input, a multi-byte-character input of even byte length (misaligned), and the existing valid/odd-length/non-hex cases.
  • cargo test -p id local_claims passes.

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    status/in-progressQueue worker lifecycle state
    on Nov 8, 2026
  2. developing-today commented on Nov 8, 2026

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

    CODE-2304

  3. dezren39
    added
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    work/self-assignedAn agent grabbed this item directly, outside the queue
    on Nov 8, 2026
  4. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    Filed this run by the new-issue-creator (lane A) after verification on the laptop against main 4af4ee8354 (probe ~/git/fleet/probe-localclaims-hex: exact copy of the function — €a input panics at the char boundary, +a pairs decode as 0x0a, valid/ASCII controls behave). Self-assigning for a guarded trivial self-solve under lifecycle protocol §4: the fix mirrors the existing #2517 ASCII gate used by the sibling parsers in directory.rs / directory_auth.rs, plus byte-chunk decoding and regression tests.

  5. developing-today
    added
    status:in-review
    on Nov 8, 2026
  6. dezren39
    added a commit that references this issue on Nov 8, 2026

    fix(id): gate local_claims hex_bytes on ASCII hexdigits (#7750) (#7757)

    4834a3e
  7. dezren39
    closed this as completedin #7757on Nov 8, 2026
  8. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 8, 2026
  9. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    Self-solve complete: PR #7757 merged as 4834a3e050bc (squash). Fix gates hex_bytes on ASCII hexdigits and decodes from byte chunks; regression test covers plus pairs, misaligned multi-byte input, valid uppercase, odd length and non-hex. Verified on the laptop before merge: cargo test -p id --lib local_claims — 9 passed, 0 failed. No queue packet (§4 self-solve).

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/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus/in-progressQueue worker lifecycle statestatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testswork/self-assignedAn agent grabbed this item directly, outside the queue

    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.