Skip to content

Fix code-scanning alerts #74-#76: Markdown cell escaping misses backslashes in the sweep scripts #2546

Description

@cliffhall

Problem

Three high-severity CodeQL alerts are open on main, all js/incomplete-sanitization: "This does not escape backslash characters in the input." The same code is on v2/main.

Alert Location Code
#74 scripts/dependabot-alerts.mjs:435 const cell = (value) => String(value).replace(/|/g, "\|");
#75 scripts/dependabot-alerts.mjs:679 a.summary.replace(/|/g, "\|")
#76 scripts/sdk-watch.mjs:442 const cell = (value) => String(value).replace(/|/g, "\|");

Each helper escapes | for a Markdown table cell but not \. A value ending in a backslash (for example abc\) yields abc\\| after escaping, which re-exposes the pipe and breaks the table row. The values include advisory summaries and upstream text, so they are not fully under our control. The impact is limited to the rendering of bot-filed issue bodies, but the alerts are real and will keep flagging every release PR.

Change

  • Escape the backslash before the pipe (.replace(/\\/g, "\\\\").replace(/\|/g, "\\|")), in one shared helper both scripts import rather than three copies.
  • Add a test case with a trailing backslash.

Acceptance

Part of tracker #2543. Needs no credential; can start now.

Activity

  1. added this to the v2.10.0 milestone on Sep 30, 2026
  2. added
    v2Issues and PRs for v2
    choreMaintenance: deps, build tooling, CI, cleanup — no user-facing behavior change
    on Sep 30, 2026
  3. cliffhall commented on Sep 30, 2026

    @cliffhall
    MemberAuthor

    Triage: Priority Medium (total 7)

    Board: #28, Status Todo. Part of tracker #2543.

  4. modified the milestones: v2.10.0, v2.11.0 on Oct 7, 2026
  5. self-assigned this
    on Oct 7, 2026
  6. modified the milestones: v2.11.0, v2.10.0 on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

choreMaintenance: deps, build tooling, CI, cleanup — no user-facing behavior changev2Issues and PRs for v2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions