Skip to content

kubescape-backlog-bridge: report() renders titles unsanitized and unbounded, so the preview differs from what write filesΒ #2924

Closed

Description

@devantler

πŸ€– Generated by the Agentic Engineer

Evidence

Found while doing the user evaluation for #2917 β€” running the real command against live cluster data,
not by reading the code.

The two modes render the title through different paths:

path call site sanitized? bounded?
write (what gets filed) issues.go:395 β†’ renderTitle(t) βœ… βœ… 256 runes
report (the preview) main.go:1210 β†’ t.Title() raw ❌ ❌

Reproduced against a real workloadconfigurationscansummaries object from admin@prod, with its
control key replaced by a 1400-character id:

rendered title runes = 1432
ends with ellipsis   = False

The same theme through the write path renders 256 runes ending in ….

Affected audience and impact

Two distinct consequences, both small but real:

  1. The preview does not preview. -mode report is how an operator sees what a write run would
    file. A title that differs between the two means the report is not a faithful dry run.
  2. The report's TSV can be broken by untrusted input. report() emits tab-separated fields, and
    sanitizeForIssue is precisely what folds \r/\n into spaces. Because report bypasses it, a
    control key or CVE key containing a tab or newline would split a row and corrupt the output for
    anything parsing it. Scanner output is untrusted by this tool's own stated design premise, so
    "control ids are always C-0034-shaped" is an assumption the rest of the package deliberately
    refuses to make.

Not a security issue: report() writes to an io.Writer (stdout), never to a GitHub artifact, so
the unsanitized @-mention and backtick handling that matters for bodies does not apply here.

Expected behaviour

Report and write render a theme's title identically, through one function.

Smallest useful change

Have report() call renderTitle(t) instead of t.Title(). Both live in the same package.

Worth deciding deliberately rather than assuming: bounding the preview is arguably wrong if an
operator wants to see the full key. If so, the fix is to sanitize in report (closing consequence 2)
and to display the truncation explicitly, rather than silently rendering a different title from the
one that would be filed.

Acceptance criteria

  • A theme's title is rendered by one function for both modes, or the divergence is documented
    with its rationale.
  • A control/CVE key containing a tab or newline cannot break the report's TSV row structure;
    proved by a test with that input.
  • The report of a theme whose title would be truncated on filing makes that visible.

Rough size

XS. Pre-existing β€” not introduced by #2917, which bounded only the write path because that is
where the failure it fixed occurs (an over-long title fails gh issue create and, via applyPlan's
stop-at-first-failure, blocks every remaining action in the run).

Activity

  1. added theissue type on Aug 3, 2026
  2. coderabbitai commented on Aug 3, 2026

    @coderabbitai
    Contributor
    πŸ”— Related PRs

    #2830 - feat(ci): publish Kubescape posture findings to Code Scanning [merged]
    #2847 - fix(ci): report what the Kubescape scan actually found [merged]
    #2876 - feat(security): derive themed, deduped backlog entries from live Kubescape findings [merged]


    πŸ“ Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    πŸ§ͺ Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    πŸ’¬ Have feedback or questions? Drop into our discord!

  3. moved this to πŸ“₯ Backlog in 🌊 Project Boardon Aug 3, 2026
  4. self-assigned this
    on Sep 21, 2026
  5. added a commit that references this issue on Sep 21, 2026
  6. moved this from πŸ“₯ Backlog to πŸ‘€ In Review in 🌊 Project Boardon Sep 21, 2026
  7. moved this from πŸ‘€ In Review to βœ… Done in 🌊 Project Boardon Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions