GeezerVison is showing github.com — id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns · Issue #1735 · developing-today/code
id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735Labels app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DescriptionProblem
The plain-text output of id tag list / id tag search (and the tag set: echo) renders the tag's subject, key and value raw into a tab-separated one-line-per-tag format. Meta-tag subjects, keys and values are arbitrary bytes with no control-character validation anywhere on the write path, so a value (or key, or subject) containing a newline forges an entire extra row in another node's listing, and a tab forges extra columns. This is the same forgery class as #1611 (claim/doc/group key=value renderer, fixed in #1703 via group::text()) and #1613 (peer names in id peers), but a different renderer, a different store and a different protocol — neither issue covers it: the meta-tag renderer does not go through tokens() at all.
Evidence (verified this run, main 0e245370)
- Rendering:
print_tag_line (pkgs/id/src/commands/tag.rs:373-380) prints format!("{subject}\t{key}={}", opts.format_value(v)) where subject/key are String::from_utf8_lossy of the raw bytes. TagDisplayOptions::format_value (tag.rs:104-131) returns valid-UTF-8 values verbatim (only length-truncation at 256 bytes on a char boundary); the <binary N bytes> / hex summaries apply only to non-UTF-8 values. The run_set echo (tag.rs:249, tag set: {subject} [{key}={}]) prints subject/key raw the same way.
- Write path admits the payload:
TagStore::set_tag (pkgs/id/src/tags.rs:800-845) documents subject/key/value as "arbitrary bytes" and stores them with no validation; the meta protocol handler (pkgs/id/src/protocol.rs:589-598) passes them straight through. Tags sync between nodes (α/Ω iroh-docs stores), so the crafted bytes do not have to be typed by the person reading the listing.
- Same class in the sibling TSV listings of the same name space:
id list prints {hash}\t{name} raw (pkgs/id/src/commands/list.rs:91,110,157) and the find renderers print {hash}\t{name} raw (pkgs/id/src/helpers.rs:155-176,192-233,246-265) — a stored blob name containing LF/TAB forges rows there too.
- Probe (verbatim
hex_encode + truncate_on_char_boundary + format_value + the print_tag_line rendering, run on the laptop; commands/tag.rs sha256 d2d52342… on main 0e245370; probe + log in the goal's hidden_files/probe-2026-10-28-laneB-tagforge/):
- Control
README.md / priority=high → 1 physical line, 2 tab fields.
- value
x\nEVIL.bin\towner=attacker → 2 physical lines; the second is a fully-formed forged tag row naming a different subject.
- value
a\tb → 3 tab fields in one row (column forgery).
- key
k\nEVIL.bin\towner=attacker → 2 physical lines, forged row.
- subject
a\nEVIL.bin → 2 physical lines, forged row.
- value
a\rb → raw CR passes through.
- Non-UTF-8 value
[0xff, 0x0a] → summarised as <binary 2 bytes> — the safe path exists, but only off the UTF-8 branch.
Why it matters
id tag list output is the machine-adjacent listing operators and fleet scripts split on tabs/newlines. A tag synced from a peer (or set once via --value-file/the meta protocol with arbitrary bytes) can plant a phantom row attributing tags to a different file in every subsequent listing — the exact output-forgery pattern #1611/#1613 guard against in the neighbouring renderers. The UTF-8 fast path in format_value is the odd one out: binary values are already summarised safely.
Acceptance criteria
- Plain output of
id tag list / search and the tag set: echo is always one physical line per tag, whatever bytes the subject, key or value contain (escape/quote values containing whitespace or control characters, or summarise them like the non-UTF-8 path — the rule is pinned by tests and stated in the module doc at commands/tag.rs:14-22).
- A tab-splitting consumer recovers exactly the real fields: no forged rows and no extra columns from crafted subject/key/value bytes (probe cases above).
- The same rule is applied (or explicitly scoped out with a reason) for the sibling raw TSV name listings:
id list (commands/list.rs) and the find renderers (helpers.rs print_match_cli/print_matches_cli/print_match_repl).
- Ordinary space-free printable values and names render byte-identically to today;
--hex/--binary behaviours are unchanged.
- Tests pin the rule at
format_value/print_tag_line level, mirroring the renderer tests added for id(claim/doc/group): plain-text output renders names/values raw — a newline in a tag name or value forges extra rows and duplicate author=/event= fields #1611 in commands/group.rs.
Triage note: renderer-side escaping/summarising is likely the load-bearing fix (refusing control bytes at set_tag would change what synced stores may hold and would not clean rows already stored); whether to also refuse at write time is the triage pin. Activitydeveloping-today commented on Oct 28, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/idPackage/app: id (pkgs/ or apps/ in this repo) effort/sSmall: expected under 2 hours of work on Oct 28, 2026dezren39 commented on Oct 28, 2026 dezren39 commented on Nov 4, 2026
Launched and bound queue task 7724 to OpenCode session ses_e5e5a84c0b0ffexJ5xqDad5jxj via opencode-route/workhorse (build). The task claim remains owned by repo-worker-code. dezren39 commented on Nov 4, 2026 Coverage triage (corrected 2026-11-04)
Revalidated against current main at ce17248: #1735 remains open and the tag renderer is still vulnerable. In pkgs/id/src/commands/tag.rs, run_set still echoes subject/key raw at lines 255–256, and print_tag_line still emits lossy subject/key raw at line 379; format_value also returns valid UTF-8 verbatim. The minimal fix path is renderer-side escaping for those tag fields, reusing the existing commands::text::plain_field helper and preserving formatted binary-summary behavior.
Scope correction: current main already routes file-list names through commands::text::list_tsv_row and find output through plain_field/tsv_row. Those sibling renderers do not need another fix. PR #3756 is still open, but it is based on dad9ddd and the main-vs-PR comparison is diverged (1 commit ahead, 2223 behind); its list/helpers changes overlap functionality now present on main. Its unresolved P2 thread on helpers.rs:62 also reports a plain-space test mismatch and changed binary-summary output in that PR's implementation.
Ordering/blocker: reconcile #3756 with current main, drop/reuse the already-landed sibling renderer work, and address the tag-only behavior plus the P2 plain-space/binary-summary concern; then obtain code-owner review and merge. Keep #1735 open until the tag fix lands. If #3756 cannot be refreshed, route a focused tag-only change without duplicating the sibling fix. developing-today commented on Nov 8, 2026 🤖 Agent note · claimed
- Agent: queue worker (repo-worker-code, lane code-c)
- Session / ID: queue task 11958
- Found via: queue claim (triage, re-queued under triage doctrine, task 11958)
- Task: Re-triage issue id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735 on current state: confirm real-and-current, annotate, and convert to a fix packet unless validated invalid. Open PR fix(id): escape synced fields in TSV renderers #3756 (fix(id): escape synced fields in TSV renderers, Closes id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735) exists unmerged — revalidate it against current main before routing.
- Expectation: Triage verdict + routed follow-up recorded on issue id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735 in this pass.
- Links: id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735 · fix(id): escape synced fields in TSV renderers #3756
developing-today commented on Nov 8, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code, lane code-c)
- Session / ID: queue task 11958
- Found via: queue claim (triage, re-queued under triage doctrine)
- Task: Triage verdict for issue id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735: REAL-AND-CURRENT. Fresh evidence 2026-11-08: issue id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735 OPEN with no held / user/owned / do-not-merge / do-not-auto-edit labels; current main edef348 has no display_text_field in pkgs/id/src/helpers.rs or pkgs/id/src/commands/tag.rs, and print_tag_line (tag.rs:379) still renders subject/key/value raw — the forgery is live and the fix is NOT landed.
- Expectation: Routed: PR fix(id): escape synced fields in TSV renderers #3756 (fix(id): escape synced fields in TSV renderers, branch queue/4797-1735-render-sanitize, Closes id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735) already implements the fix but was never merged — task 4797 completed as pr_opened only. The literal fix dedupe key (repo-health:v1:fix:developing-today/code:issue:1735) dedupes to terminal task 4797 and cannot re-queue, so the remaining work is enqueued as task 12569 (pr_shepherd, dedupe repo-health:v1:pr:developing-today/code:pr:3756): disposition every Codex finding on PR fix(id): escape synced fields in TSV renderers #3756, verify targeted tests/CI, merge it. Issue id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735 stays OPEN until that merge closes it.
- Links: id(tag): meta-tag TSV output renders subject/key/value raw — a newline in a synced tag value forges extra rows in id tag list, and a tab forges columns #1735 · fix(id): escape synced fields in TSV renderers #3756
MetadataMetadataapp/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DevelopmentNo branches or pull requestsIssue actions
|