Repository navigation
fix(devkit bench): the PR comment renders the summary's tables - #1145
Merged
Merged
Conversation
Security scan found no critical or high findings on lines changed by this pull requestView the security scan run for complete reports. “New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta. |
The bench comment wrapped summary.md in a ```text fence, so its Markdown tables showed as raw pipes. The fence was the safety measure: a pull request's code writes that artifact, and the comment is posted with a write token. The comment now renders it as Markdown, inside <details>, after sanitize() takes out everything that acts: - backslashes are escaped first, then [ ], so no link or image survives (a backslash in the input cannot cancel an added one); - < > & are escaped: no HTML, so the text cannot close the <details>, hide or forge the marker, or add an element; - every //, www. and github.com, @ mentions, and #12, GH-12 and .../issues|pull|discussions/12 references are broken with a zero-width space: no URL of any scheme, no mention, no cross-reference; - control and bidi characters are dropped; the text is cut at a line past 60000 characters. sanitize() stays inline (the workflow checks nothing out). test_devkit_bench.py BenchComment extracts and tests it. An adversarial review found the backslash and path-reference bypasses, which are fixed and tested. Rendered through GitHub's Markdown API, #1131's summary gives 4 tables and only the run link. Its bypass inputs give no link, image, mention, issue link or </details>. Co-Authored-By: Claude <noreply@anthropic.com>
zaneni6
force-pushed
the
fix/bench-comment-markdown
branch
from
November 25, 2026 17:43
d7d1fa2 to
28d5125
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The "Dev-kit bench" PR comment wrapped
summary.mdin a```textfence, so its tables showed as raw|pipes (see #1131). The fence was there for safety: the artifact is written by the pull request's code (a fork's too), anddevkit-bench-comment.ymlposts with a write token. Rendering it as Markdown therefore needs everything that could act to be taken out first.What
The summary is rendered as Markdown inside
<details>, aftersanitize(). That function lives in the workflow's inline script, because the workflow still checks nothing out. It:[], so no link or image survives. A backslash in the input cannot cancel an added one; that was a real bypass found in review.<>&, so no HTML: the text cannot close the<details>, forge or hide the marker, or add an element.//,www.andgithub.com, every@mention, and#12,GH-12and…/issues|pull|discussions/12references with a zero-width space. The result has no URL of any scheme, no mention and no cross-reference, path forms included; those were found in review too.Headings, tables, lists, inline code and emoji render as before.
Testing
BenchCommentintest_devkit_bench.pyextractssanitize()from the workflow and tests it against the bypass inputs.\[x\](//host),[x](//host),,http:host,<a>, entities,/issues/4,github.com/o/r/pull/1,@user,@org/team,a@b.com,#7,GH-8,</details>, the marker. Result: 0 links, images, mentions, issue links or</details>.devkit_check(including its bench-comment rules) andcheck_internal_refs.🤖 Generated with Claude Code