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(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns · Issue #2839 · developing-today/code

id(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns #2839

New issue
Copy link
New issue
Copy link
Closed
Closed
id(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns#2839
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Oct 30, 2026
Issue body actions

Problem

plain_field (pkgs/id/src/commands/text.rs:42-44) — the renderer whose whole job is making untrusted values row-safe in plain-text output (#1613) — treats a value as structure-breaking only when it contains a char::is_control character or U+2028/U+2029:

fn breaks_row(c: char) -> bool {
    c.is_control() || matches!(c, '\u{2028}' | '\u{2029}')
}

Unicode bidirectional and format controls are category Cf, not Cc, so is_control() is false for all of them: U+202A–U+202E (embedding/override, incl. RIGHT-TO-LEFT OVERRIDE), U+2066–U+2069 (isolates), U+200E/U+200F (LRM/RLM), U+200B, U+FEFF. They reach the terminal raw in both paths:

  1. Unquoted path: a peer name carrying only an override (no tab/newline) is returned byte-identical by plain_field.
  2. Quoted path: even when quoting does trigger (e.g. the name also contains a tab), the escape loop in plain_field (text.rs:62-86) only escapes characters breaks_row matches — the override is emitted raw inside the quotes, where it still acts on the terminal rendering.

Evidence (verified this run, main a8ea41ae)

Probe crate on the laptop (~/git/fleet/probe-2026-10-30-laneA-bidi/) running breaks_row/plain_field copied verbatim from src/commands/text.rs:

  • U+202A..U+202E, U+2066..U+2069, U+200E, U+200F, U+200B, U+FEFF: is_control=false, breaks_row=false for every one.
  • plain_field("mallory\u{202e}9 0") returns the input byte-identical, unquoted, with a raw U+202E in the output.
  • A name with a tab + U+202E is quoted, but the output still contains the raw U+202E.

Callers put the result in fixed-column rows whose trailing fields are exactly what an override reorders visually:

  • format_peer_row (src/commands/peers.rs:206-219): <node_id>\t<name>\t<blob_count>\t<timestamp> — the name arrives over unsigned gossip, is stored and served verbatim (peers.rs:116-121), so any peer can announce such a name. In a terminal, U+202E reverses the visual order of the text after it: the blob-count/timestamp columns can be made to read swapped or falsified, defeating the column structure id(peers): a peer's announced name is printed raw — a newline in a gossip announcement forges extra TSV rows in id peers and the REPL #1613 exists to protect.
  • Same renderer in the REPL peer list (src/commands/repl.rs:116-123).

Sibling surfaces with the same is_control-only assumption, to audit in the same pass (not necessarily the same fix): the key=value renderer text() in src/commands/group.rs:66 (quotes only on whitespace/control; serde_json string rendering does not escape Cf either) and sanitize_display_name/sanitize_chat in src/world/util.rs:69-84 (filter only is_control).

Why it matters

The #1611/#1613 ruling is that a printer never lets an untrusted value be mistaken for structure. A bidi override does not add a row or shift a byte column — it corrupts what the row appears to say, which is the terminal-level equivalent: a malicious peer name can visually falsify the numeric columns next to it. This is the Trojan-Source class of characters (CVE-2021-42574) applied to live CLI output.

Acceptance criteria

  • plain_field quotes and escapes (\uXXXX) the bidi/format controls — at minimum U+202A–U+202E, U+2066–U+2069, U+200E, U+200F — whether they appear alone or alongside an already-escaping character; a rendered field never contains a raw Cf override/isolate/mark.
  • Ordinary names are unchanged byte-for-byte: spaces, CJK, emoji, accented letters (the existing test corpus in text.rs) still render unwrapped.
  • Regression tests in src/commands/text.rs covering: override-only name is quoted+escaped; override+tab name has no raw override inside the quotes.
  • The sibling surfaces (group.rs text(), world/util.rs sanitizers) are audited and either fixed in the same PR or explicitly filed as follow-ups from triage.
  • Triage pins the exact character set (embeddings/overrides/isolates/marks, and whether zero-width chars U+200B–U+200D/U+FEFF are in scope) before the fix packet is routed.

Dedup checked this run: open+closed search for bidi/plain_field/Trojan/unicode-spoof — no hits; #1611/#1613/#1856 cover tab/newline/space escaping only.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/lowNice to have; do when convenient
    queue/queuedHas a queued queue task
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 30, 2026
  2. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane A)
    • Session / ID: new-issue-creator-code-a, cron run 2026-10-30 16:35 CDT
    • Found via: filed this run
    • Task: Filed after verifying with a laptop probe (verbatim breaks_row/plain_field from main a8ea41a) that bidi/format controls (U+202A–U+202E, U+2066–U+2069, U+200E/F) are not is_control, pass plain_field raw — byte-identical when alone, raw inside quotes when a tab also triggers quoting — and so reach the id peers / REPL rows from unsigned gossip names.
    • Expectation: effort/xs triage — pin the exact Cf character set, then route a small_fix packet.
    • Links: probe laptop ~/git/fleet/probe-2026-10-30-laneA-bidi/; evidence in issue body.
  3. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  4. dezren39
    added a parent issue on Nov 1, 2026
    • Design: a value cannot act on the terminal — one format-character (Cf) contract for pkgs/id plain output #3455
  5. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Nov 1, 2026
  6. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    Adopted as Phase 1 of design #3455 (a value cannot act on the terminal — one format-character contract for pkgs/id plain output; design doc files/designs/code-id-plain-output-rendering.md in the keep-the-four-repos-healthy goal workspace). Triage: do NOT re-file, re-scope or split this issue — record the phase structure instead.

    Decisions recorded on #3455 that bind this phase:

    • The character-set question in this issue's acceptance is PINNED: the full Unicode 16 category-Cf set already defined in-tree as petname.rs's is_format_char — including U+200B–U+200D and U+FEFF — promoted to one shared pub(crate) definition by this phase. No renderer-local subset.
    • Sibling audit disposition (this issue's acceptance bullet 4): group.rs text() is fixed as Phase 2 (id(group/doc/claim): the shared key=value renderer passes bidi/format controls (Cf) raw — a claim value with U+202E reaches the terminal unescaped in both the unquoted and quoted paths and visually reorders the row's author=/event= fields #3111); the world/util.rs sanitizers are dispositioned by the closing audit, Phase 3b (Phase 3b (audit) of #3455 — closing is_control inventory + plain-output contract statement #3456). Both are filed and linked as sub-issues of Design: a value cannot act on the terminal — one format-character (Cf) contract for pkgs/id plain output #3455 — no separate follow-ups needed from this issue's triage.
    • This phase lands first: it creates the shared set definition Phases 2/3b use, and its Cf coverage flows automatically to Phase 3a (id(world): world list plain output renders host-supplied names raw — a newline in a world name forges extra rows, and a tab forges columns #3089) once id(world): world list plain output renders host-supplied names raw — a newline in a world name forges extra rows, and a tab forges columns #3089 routes world names through plain_field.
  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    on Nov 1, 2026
  8. 58 remaining items

  9. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 2, 2026
  10. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked (cargo load gate)

    • Agent: repo-worker-code (Lane A cron shift)
    • Session / ID: Lane A shift 2026-11-02 03:24 CST; queue task 5439 (small_fix, attempt 1)
    • Disposition: Parked 1 hour (until 2026-11-02T11:08:13Z). PR fix(id): plain_field escapes the shared Unicode 16 Cf set (#2839) #4264 is ready except cargo verification; laptop load 117/108/95 (16 cores) makes a cargo run untrustworthy, and CI is queued behind the runner backlog.
    • Resume condition: Low-load window → cargo test -p id commands::text::tests + petname tests + id suite on the laptop worktree ~/git/fleet/5439 @90782ce75 → merge PR fix(id): plain_field escapes the shared Unicode 16 Cf set (#2839) #4264 → id(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns #2839 closes → complete task 5439 (also clears the Phase-1 gate for task 5635 / id(group/doc/claim): the shared key=value renderer passes bidi/format controls (Cf) raw — a claim value with U+202E reaches the terminal unescaped in both the unquoted and quoted paths and visually reorders the row's author=/event= fields #3111).
  11. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  12. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane D shift
    • Session / ID: task 5439
    • Found via: queue claim (resume of parked task 5439)
    • Task: Resuming task 5439 on issue id(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns #2839: PR fix(id): plain_field escapes the shared Unicode 16 Cf set (#2839) #4264 (branch queue/5439-2839-plain-field-unicode-cf @ 90782ce) is implementation-complete and Codex-clean; this shift runs the cargo verification (cargo test -p id) in a load window, then merges PR fix(id): plain_field escapes the shared Unicode 16 Cf set (#2839) #4264 and closes issue id(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns #2839.
    • Expectation: effort/xs; done = PR fix(id): plain_field escapes the shared Unicode 16 Cf set (#2839) #4264 merged, issue id(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns #2839 closed, task 5439 completed fixed_merged.
    • Links: PR fix(id): plain_field escapes the shared Unicode 16 Cf set (#2839) #4264
  13. dezren39
    added a commit that references this issue on Nov 2, 2026

    fix(id): plain_field escapes the shared Unicode 16 Cf set (#2839) (#4264

    734e8c5
  14. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane D shift
    • Session / ID: task 5439
    • Found via: queue claim (resume of parked task 5439)
    • Task: Task 5439 complete: PR fix(id): plain_field escapes the shared Unicode 16 Cf set (#2839) #4264 MERGED (squash, merge commit 734e8c5). plain_field now escapes the shared Unicode 16 Cf set via the promoted pub(crate) predicate; ordinary text preserved byte-for-byte.
    • Expectation: Verified on the laptop at head 90782ce: cargo test --lib commands::text:: = 28 passed; petname = 51 passed; id-core suite = 253 passed + 3 doc-tests. Codex review clean (no findings). PR CI was still queued at merge (Actions runner backlog); main CI is the backstop per merge authority. This unblocks task 5635 (issue id(group/doc/claim): the shared key=value renderer passes bidi/format controls (Cf) raw — a claim value with U+202E reaches the terminal unescaped in both the unquoted and quoted paths and visually reorders the row's author=/event= fields #3111 Phase 2).
    • Links: PR fix(id): plain_field escapes the shared Unicode 16 Cf set (#2839) #4264
  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  16. dezren39
    closed this as completedon Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

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.