Skip to content

fix(knowledge): escape backslashes in video-digest queue table cells - #15532

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/knowledge-table-cell-backslash
Nov 12, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/knowledge-table-cell-backslash

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

No related issue: owner decision (2026-11-12) to clear code-scanning alerts

Summary

Clears code-scanning alert 129 (js/incomplete-sanitization). The video-digest preflight writes a YouTube title, which anyone can set, into a markdown table cell. escapeTableCell escaped | but not \, so a title ending in a backslash escaped the cell's closing pipe and broke the queue row.

Fix

  • escapeTableCell escapes both \ and |.
  • The display title is capped before it is escaped, so the cap can no longer cut an escape in half and leave a dangling backslash.
  • watch-queue.md names both escapes.

Verification

  • vitest run acquisition/preflight-metadata.test.js in plugins/knowledge/skills/video-digest/extraction: 23 passed, including cases for a trailing backslash, for \|, and for capping before escaping.
  • Left out: the rest of the knowledge suites; only this file changed.

Done when

  • A title with a backslash yields a cell that keeps the row's column count (covered by the new test).
  • Alert 129 closes on the first code-scanning analysis of main after this merges; it is not dismissed.

Related

N/A

🤖 Generated with Claude Code

https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe

escapeTableCell escaped `|` but not `\`, so a video title ending in a
backslash escaped the cell's closing pipe and broke the queue row. It now
escapes both, and the title is capped before it is escaped so the cap can
no longer split an escape.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 12, 2026 04:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T04:02:20.077641Z 93ae21f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 886c1c879b29775813dbbf881f044dcf947f5f07: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #15532 at 886c1c87

I found no security issues in this change. Because this lane had already reviewed an earlier head, I reported only CRITICAL and IMPORTANT findings, and there were none.

I read every hunk of all 4 changed files. None of them matches a trusted path. The change does not touch a trust control, a plugin manifest, a merge hold or a standing instruction.

  • preflight-metadata.js: escapeTableCell now escapes both \ and | (/[\\|]/g → \\$&). The display title is now capped before it is escaped (escapeTableCell(truncateTitle(title))), so the cap cannot cut an escape sequence in half. This hardens the handling of an untrusted YouTube title written into a markdown table cell. Before this change, a trailing backslash could escape the cell's closing pipe and break the queue row. I found no new way to inject anything.
  • preflight-metadata.test.js: adds test cases only. One of them covers the cap-before-escape order, which closes the earlier settled thread.
  • watch-queue.md: a documentation change that now lists both escapes. It removes no rule.
  • .changes/ fragment: changelog text only.

The PR description and settled threads contain no instructions aimed at this review.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 93ae21f8599bd613d786f37035c5f935d52e90a8; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 886c1c879b29775813dbbf881f044dcf947f5f07: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #15532 (blocking only)

This lane already reviewed an earlier head (93ae21f8), so this pass looked only for blocking findings. It found none.

What changed since the last review: a new preflightVideo test (preflight-metadata.test.js:197-204). It puts a | at the cap's last kept position and expects xxx…\|…. I worked both orders through truncateTitle (preflight-metadata.js:86-93) by hand:

  • New order (cap, then escape): the title is cut to 58 x + |, then escaped, giving 58 x + \|…. This matches the assertion.
  • Old order (escape, then cap): the cut lands after the \ of the escape, giving 58 x + \…. The test fails on that.

So the test now catches a revert to the old order. That covers the advisory finding from the earlier head, which the owner resolved as fixed in 86a41fd. That point is settled, so I don't raise it again.

Correctness: The fix is correct.

  • /[\\|]/g → "\\$&" escapes \ and | in a single pass, so nothing is escaped twice.
  • escapeTableCell has three other callers (note, reason and the reject reason at preflight-metadata.js:308-309,403). They now escape backslashes too. That is consistent with the fix and breaks none of them.

Other checks:

  • The changelog fragment's bump: patch fits a bug fix.
  • No plugin manifest changed, so the manifest checks don't apply.
  • The PR closes no issue, so there are no closing-issue criteria to check. The PR context contains no embedded instructions.
  • I did not run the tests. The "23 passed" result comes from the author and is unverified.

kyle-sexton and others added 2 commits November 11, 2026 23:48
A pipe at the cap's last kept position now pins the order: escaping
first would leave a dangling backslash before the ellipsis.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit d4cafdb Nov 12, 2026
46 checks passed
@kyle-sexton
kyle-sexton deleted the fix/knowledge-table-cell-backslash branch November 12, 2026 06:25
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant