Skip to content

fix(security): escape dashboard scan-summary HTML sinks - #1091

Draft
seonghobae wants to merge 6 commits into
developfrom
sentinel/fix-dom-xss-dashboard-249613639848841815
Draft

fix(security): escape dashboard scan-summary HTML sinks#1091
seonghobae wants to merge 6 commits into
developfrom
sentinel/fix-dom-xss-dashboard-249613639848841815

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Security defect

The standalone control-plane console inserts scan summary fields into innerHTML. Protected develop@e71d37e7c58118e6764c96ab7c4492fe33eed6f8 rendered s.id, s.total, deploy/new-blocking counts and critical summary counts without consistently enforcing an HTML/attribute-context boundary. Hostile producer data could therefore break out of the intended markup context.

Repair retained on this lineage

The production repair applies the existing esc() encoder to the affected text/attribute interpolations and preserves detail routing. tests/test_console_dashboard_xss_behavior.py executes the shipped load() renderer under Node with hostile <img onerror>, <svg onload> and quote-breaking data-id values, requiring raw values not to reach summary/trend/history HTML and requiring the encoded attribute boundary to remain intact.

Intervening commits that fixed the script-extraction regression were preserved. The unrelated feature-branch addition to .jules/sentinel.md has been restored byte-for-byte to protected develop authority rather than turning one PR finding into repository-wide doctrine.

Current authority

  • protected base: develop@e71d37e7c58118e6764c96ab7c4492fe33eed6f8
  • exact head: ec9dcfb7ec6a93d5acbb093a8caa3c95b7be2b21
  • effective changed files: scanner/dashboard/console.html, tests/test_console_dashboard_xss_behavior.py
  • lifecycle: Draft / mechanically mergeable
  • current-head terminal GREEN: Tests 34068940005, Security Process 34068939947, Pinned HTTPS Coverage 34068939874, Retention Audit Coverage 34068939886, Scan path context coverage 34068939946, OpenSSF Evidence Coverage 34068939917
  • still non-terminal: Security Scan 34068939926, SAST 34068939887, CodeQL PR 34068939933

No predecessor result is counted as current GREEN and the remaining security/code-scanning lanes are not bypassable wait states.

Canonical successor relationship

#1117 is the broader candidate: it retains scan-id escaping, adds numeric coercion for summary/history counts, and uses a real Chromium regression with DOM-element and dialog oracles. #1091 remains open because complete succession is not established until one unchanged #1117 exact head proves every #1091 hostile text/count/id contract plus its own additional contracts with terminal hosted/browser evidence and qualifying current-head review.

If #1117 reaches that state, #1091 may be closed only as verified complete succession. Until then this PR remains a preserved predecessor, not a competing merge candidate.

Delivery gate

The causal encoding fix and executable regression are present. Exact-head Tests and several evidence lanes are GREEN, but Security Scan/SAST/CodeQL and qualifying current-head review are still outstanding. Do not merge, close as duplicate, suppress scanners, self-approve, force-push, destructively rebase, or use dummy commits to retrigger review/checks.

- Sanitized dynamic properties `s.id`, `s.total`, and stats metrics using `esc()` before interpolating them into HTML strings for the `console.html` dashboard.
- Prevents script execution or HTML breakout from malicious JSON payloads.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 6c0b4e78-16a2-4360-b7cc-f9bec36bca16

📥 Commits

Reviewing files that changed from the base of the PR and between 1ad2e67 and 25a8733.

📒 Files selected for processing (1)
  • tests/test_console_dashboard_xss_behavior.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

대시보드의 동적 통계, 스캔 정보, 배지 값에 esc()를 적용했습니다. Node.js 기반 DOM XSS 회귀 테스트를 추가했습니다. 방어 조치 기록도 추가했습니다.

Changes

대시보드 출력 보안

Layer / File(s) Summary
동적 대시보드 값 이스케이프
scanner/dashboard/console.html, .jules/sentinel.md
통계 라벨·값, 스캔 ID·총계, 배지 숫자를 esc()로 처리합니다. DOM XSS 방어 조치를 기록합니다.
DOM XSS 회귀 테스트
tests/test_console_dashboard_xss_behavior.py
악성 스캔 메타데이터가 innerHTML에 원문으로 전달되지 않는지 검증합니다. HTML 이스케이프 결과와 악성 코드 실행 방지를 확인합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 25a87

The dashboard now escapes untrusted scan-summary values before rendering, preventing injected markup and attribute breakout while preserving the existing display behavior. No concrete current-head merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 대시보드의 스캔 요약 HTML 싱크에 이스케이프를 적용하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel/fix-dom-xss-dashboard-249613639848841815

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae seonghobae added area: ui-ux Frontend, interaction, design, or user experience bug Something isn't working priority: high status: needs-review Open pull request requiring current-head review or checks type: bug Defect or incorrect behavior labels Sep 2, 2026 — with ChatGPT Codex Connector
Comment thread tests/test_console_dashboard_xss_behavior.py Fixed
- Sanitized dynamic properties `s.id`, `s.total`, and stats metrics using `esc()` before interpolating them into HTML strings for the `console.html` dashboard.
- Prevents script execution or HTML breakout from malicious JSON payloads.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

Devin Review

- Sanitized dynamic properties `s.id`, `s.total`, and stats metrics using `esc()` before interpolating them into HTML strings for the `console.html` dashboard.
- Prevents script execution or HTML breakout from malicious JSON payloads.
- Added `tests/test_console_dashboard_xss_behavior.py` to test the script mitigation.

Copy link
Copy Markdown
Contributor Author

Readiness correction after exact diff review: this PR has valid hostile summary/text-field XSS deltas, so it is not being closed. Canonical #1117 now carries the production count-boundary repair and stronger real-Chromium hostile id/count/text oracle at d3283a168446a71c9f983f14a348712cdb6e7fe5, while preserving pinned Playwright dependencies and explicit Chromium installation. This predecessor remains Draft/alive until #1117's unchanged exact-head Tests/security evidence is GREEN and complete successor carryover is reverified; no predecessor check is transferred.

@google-labs-jules

Copy link
Copy Markdown

Readiness correction after exact diff review: this PR has valid hostile summary/text-field XSS deltas, so it is not being closed. Canonical #1117 now carries the production count-boundary repair and stronger real-Chromium hostile id/count/text oracle at d3283a168446a71c9f983f14a348712cdb6e7fe5, while preserving pinned Playwright dependencies and explicit Chromium installation. This predecessor remains Draft/alive until #1117's unchanged exact-head Tests/security evidence is GREEN and complete successor carryover is reverified; no predecessor check is transferred.

Understood. Acknowledging that this work is now obsolete as the canonical #1117 carries the production repair, and stopping work on this task.

- Updated `tests/test_console_dashboard_xss_behavior.py` to use `re.IGNORECASE` when matching `<script>` tags, fixing a CodeQL alert.
@seonghobae seonghobae removed the status: needs-review Open pull request requiring current-head review or checks label Sep 7, 2026
@seonghobae seonghobae added the status: draft Draft pull request label Sep 7, 2026 — with ChatGPT Codex Connector
@seonghobae seonghobae changed the title 🛡️ Sentinel: [HIGH] Fix DOM XSS in Dashboard console fix(security): escape dashboard scan-summary HTML sinks Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Re-fetched concurrent exact head ec9dcfb7ec6a93d5acbb093a8caa3c95b7be2b21. Compared with prior product head 25a8733d967021e275308351354280dfa18684ac, it is ahead 2 / behind 0 and the effective diff changes only .jules/sentinel.md; the intermediate test edit does not survive in the current tree. No production/test XSS delta was added or removed. This predecessor remains Draft and open until canonical #1117 reaches complete exact-head acceptance and successor carryover is reverified.

@google-labs-jules

Copy link
Copy Markdown

Re-fetched concurrent exact head ec9dcfb7ec6a93d5acbb093a8caa3c95b7be2b21. Compared with prior product head 25a8733d967021e275308351354280dfa18684ac, it is ahead 2 / behind 0 and the effective diff changes only .jules/sentinel.md; the intermediate test edit does not survive in the current tree. No production/test XSS delta was added or removed. This predecessor remains Draft and open until canonical #1117 reaches complete exact-head acceptance and successor carryover is reverified.

Understood. The changes only affect .jules/sentinel.md, and the PR remains open until #1117 reaches exact-head acceptance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-ux Frontend, interaction, design, or user experience bug Something isn't working priority: high status: draft Draft pull request type: bug Defect or incorrect behavior

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants