Skip to content

fix(report): harden md_escape for markdown table cells - #24

Open
jannikbx wants to merge 1 commit into
BreachDirect:mainfrom
jannikbx:fix/harden-md-escape
Open

fix(report): harden md_escape for markdown table cells#24
jannikbx wants to merge 1 commit into
BreachDirect:mainfrom
jannikbx:fix/harden-md-escape

Conversation

@jannikbx

Copy link
Copy Markdown

Summary

Harden md_escape in src/report.rs so a user-controlled project/toolchain string can never break the Markdown table in render_markdown.

  • | is still escaped as \| (unchanged).
  • Backticks are now escaped as \` to prevent injected code spans.
  • Newlines/CR are replaced with a visible placeholder () so a cell can never span rows.

Motivation / Linked issue

Closes #22

Testing performed

  • cargo fmt --all -- --check — clean
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo test --locked — unit tests pass (46 passed); e2e has 8 pre-existing failures that also occur on main without this change (verified)

PR checklist

  • cargo fmt --all -- --check passes
  • cargo clippy --all-targets -- -D warnings passes
  • cargo test passes (unit; e2e failures pre-existing on main)
  • Tests included for new/changed behaviour
  • Docs updated (README, ARCHITECTURE, PRD as applicable)

Closes BreachDirect#22

Signed-off-by: Jannik Bäcker <manmut@proton.me>
@jannikbx
jannikbx marked this pull request as ready for review August 15, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

good-first-issue: harden md_escape for markdown table cells

1 participant