Skip to content

fix: resolve 7 issues from GitHub issue triage#172

Open
konamgil wants to merge 1 commit intomainfrom
fix/issue-triage-bugs
Open

fix: resolve 7 issues from GitHub issue triage#172
konamgil wants to merge 1 commit intomainfrom
fix/issue-triage-bugs

Conversation

@konamgil
Copy link
Owner

@konamgil konamgil commented Mar 3, 2026

- fix(ssr): use escapeHtmlText (not escapeHtmlAttr) for <title> content
  so quote characters render correctly in browser tab (#112)
- fix(streaming-ssr): add WeakSet to isJSONSerializable to prevent
  infinite recursion on circular reference objects (#113)
- fix(bundler): fix XSS in dev error overlay — replace innerHTML with
  safe DOM textContent APIs (#118)
- fix(css): filter Tailwind CLI progress messages from stderr so they
  are logged as info, not errors (#124)
- fix(dev): show HMR WebSocket port in port-conflict warning (#116)
- fix(template): add dev:safe script to match lockfile warning message (#128)
- fix(demo): add .gitignore to ai-chat, todo-list-mandu, island-first,
  ate-integration-test demos to prevent node_modules commit (#107)
@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

Warning

Rate limit exceeded

@konamgil has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 21 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d15ce53 and 44808c8.

📒 Files selected for processing (11)
  • demo/ai-chat/.gitignore
  • demo/ate-integration-test/.gitignore
  • demo/island-first/.gitignore
  • demo/todo-list-mandu/.gitignore
  • packages/cli/src/commands/dev.ts
  • packages/cli/templates/default/package.json
  • packages/core/src/bundler/css.ts
  • packages/core/src/bundler/dev.ts
  • packages/core/src/runtime/escape.ts
  • packages/core/src/runtime/ssr.ts
  • packages/core/src/runtime/streaming-ssr.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/issue-triage-bugs

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 and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses seven distinct issues, enhancing the stability, security, and developer experience across various parts of the system. It includes critical fixes for HTML escaping in SSR, prevents infinite loops in streaming SSR, and mitigates XSS risks in the development environment. Additionally, it refines logging for CSS processes, improves clarity in dev server warnings, and streamlines demo project management by adding appropriate .gitignore configurations.

Highlights

  • SSR HTML Escaping: Corrected HTML escaping for <title> content by using escapeHtmlText instead of escapeHtmlAttr, ensuring quote characters render correctly in the browser tab.
  • Streaming SSR Circular Reference Prevention: Added a WeakSet to the isJSONSerializable function to detect and prevent infinite recursion when encountering circular reference objects.
  • Bundler XSS Fix: Addressed a potential XSS vulnerability in the dev error overlay by replacing innerHTML with safer textContent APIs.
  • CSS Logging Improvement: Configured the CSS bundler to filter Tailwind CLI progress messages from stderr and log them as informational messages instead of errors.
  • Dev Server Port Warning: Enhanced the port-conflict warning message in the dev server to explicitly show the HMR WebSocket port.
  • Template Script Addition: Introduced a new dev:safe script in the default package.json template to address lockfile warning messages.
  • Demo .gitignore Files: Added .gitignore files to several demo projects (ai-chat, todo-list-mandu, island-first, ate-integration-test) to prevent node_modules and other build artifacts from being committed.
Changelog
  • demo/ai-chat/.gitignore
    • Added a new .gitignore file to exclude common development artifacts.
  • demo/ate-integration-test/.gitignore
    • Added a new .gitignore file to exclude common development artifacts.
  • demo/island-first/.gitignore
    • Added a new .gitignore file to exclude common development artifacts.
  • demo/todo-list-mandu/.gitignore
    • Added a new .gitignore file to exclude common development artifacts.
  • packages/cli/src/commands/dev.ts
    • Updated the port conflict warning message to display the HMR WebSocket port.
  • packages/cli/templates/default/package.json
    • Added a new dev:safe script to the package.json template.
  • packages/core/src/bundler/css.ts
    • Modified CSS error handling to log specific Tailwind CLI progress messages as info instead of errors.
  • packages/core/src/bundler/dev.ts
    • Refactored the dev error overlay to use textContent for setting element content, improving XSS protection.
  • packages/core/src/runtime/escape.ts
    • Introduced a new escapeHtmlText function for HTML text content escaping.
  • packages/core/src/runtime/ssr.ts
    • Imported and applied the new escapeHtmlText function for rendering <title> content.
  • packages/core/src/runtime/streaming-ssr.ts
    • Implemented a WeakSet to detect and prevent infinite recursion caused by circular references during JSON serializability checks.
Activity
  • No human activity has occurred on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses seven identified issues, improving the stability, security, and user experience of the application. Key improvements include fixing an XSS vulnerability in the dev error overlay, preventing infinite recursion with circular references in streaming SSR, and correcting HTML escaping for title content. The addition of .gitignore files to demo projects is also a good practice.

Note: Security Review is unavailable for this PR.

Comment on lines +536 to +548
const h2 = document.createElement('h2');
h2.style.cssText = 'color:#ff6b6b;margin:0 0 20px;';
h2.textContent = '🔥 Build Error';
const pre = document.createElement('pre');
pre.style.cssText = 'white-space:pre-wrap;word-break:break-all;';
pre.textContent = message || 'Unknown error';
const btn = document.createElement('button');
btn.style.cssText = 'position:fixed;top:20px;right:20px;background:#333;color:#fff;border:none;padding:10px 20px;cursor:pointer;';
btn.textContent = 'Close';
btn.onclick = function() { overlay.remove(); };
overlay.appendChild(h2);
overlay.appendChild(pre);
overlay.appendChild(btn);

Choose a reason for hiding this comment

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

critical

Replacing innerHTML with document.createElement and textContent is a critical security improvement. This change effectively mitigates a potential Cross-Site Scripting (XSS) vulnerability by ensuring that user-provided or dynamic content is treated as plain text rather than executable HTML, preventing malicious script injection.

*/
function isJSONSerializable(value: unknown, path: string = "root", isDev: boolean = false): { valid: boolean; issues: string[] } {
const issues: string[] = [];
const seen = new WeakSet<object>();

Choose a reason for hiding this comment

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

critical

The introduction of WeakSet to track seen objects within isJSONSerializable is a critical fix. This effectively prevents infinite recursion when attempting to serialize objects that contain circular references, which could otherwise lead to stack overflow errors and application crashes.

Comment on lines +202 to +207
// 순환 참조 감지 — 무한 재귀 방지
if (seen.has(val as object)) {
issues.push(`${currentPath}: 순환 참조가 감지되었습니다 (JSON 직렬화 불가)`);
return;
}
seen.add(val as object);

Choose a reason for hiding this comment

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

critical

This logic correctly identifies and handles circular references during JSON serialization. By checking seen.has(val as object) before adding to the WeakSet, the function can gracefully report an issue rather than entering an infinite loop, ensuring the stability of the serialization process.

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${escapeHtmlAttr(title)}</title>
<title>${escapeHtmlText(title)}</title>

Choose a reason for hiding this comment

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

medium

Using escapeHtmlText instead of escapeHtmlAttr for the <title> tag content is the correct approach. The <title> element contains plain text, not an attribute value, so attribute-specific escaping (which handles quotes) is unnecessary and can lead to incorrect rendering of characters like single or double quotes in the browser tab.

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.

1 participant