Skip to content

fix(cli): use jsonc-parser to parse wrangler.jsonc - #58

Merged
Brooooooklyn merged 1 commit into
mainfrom
04-01-fix_cli_use_jsonc-parser_to_parse_wrangler.jsonc
Apr 1, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
04-01-fix_cli_use_jsonc-parser_to_parse_wrangler.jsonc

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Apr 1, 2026 •

Copy link
Copy Markdown
Member

Note

Medium Risk
Changes how wrangler.jsonc/wrangler.json is parsed during init and deploy/binding sync flows; parsing behavior differences could affect projects with edge-case config syntax.

Overview
Switches the CLI’s wrangler.jsonc handling to use the jsonc-parser library instead of ad-hoc comment-stripping/custom parsing.

This updates both init’s setupWranglerConfig and wrangler.ts’s parseJsonc (used by readWranglerCompat, syncWranglerBindings, and ensureWranglerNodejsAlsFlag) to parse JSONC with error reporting and to fail fast on parse errors. Adds jsonc-parser@3.3.1 to void dependencies and lockfile.

Written by Cursor Bugbot for commit d99eed3. This will update automatically on new commits. Configure here.

Brooooooklyn commented Apr 1, 2026 •

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 117d864db1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/cli/init.ts Outdated
Comment thread packages/void/src/cli/wrangler.ts Outdated
@Brooooooklyn
Brooooooklyn force-pushed the 04-01-fix_cli_use_jsonc-parser_to_parse_wrangler.jsonc branch from 117d864 to d99eed3 Compare April 1, 2026 07:37
@Brooooooklyn
Brooooooklyn merged commit 117dc4d into main Apr 1, 2026
18 of 20 checks passed
@Brooooooklyn
Brooooooklyn deleted the 04-01-fix_cli_use_jsonc-parser_to_parse_wrangler.jsonc branch April 1, 2026 08:09
cpojer pushed a commit that referenced this pull request Sep 11, 2026
The admin log viewer rendered entry.url, entry.method, entry.status,
and entry.outcome via innerHTML without escaping. Since entry.url
comes from user worker request URLs, an attacker could send crafted
requests to a deployed worker to inject HTML/JS that executes when
an admin views the deployment logs. Apply escapeHtml to all
user-derived fields, matching the existing treatment of log messages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low functional risk (string escaping in an admin-only view), but it addresses a potentially serious XSS injection vector from user-controlled log/request fields.
> 
> **Overview**
> Prevents HTML/JS injection in the admin deployment log viewer by escaping additional user-controlled fields before writing to `innerHTML`.
> 
> Specifically applies `escapeHtml` to `entry.method`, `entry.url`, `entry.status`, `entry.outcome`, and the load failure `err.message`, aligning these with the existing escaping used for log messages/exceptions.
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f2983095c152da77a2d551a8d54aced76ac318f3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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