Skip to content

Fix JSON repair escaping flagged by CodeQL#5

Merged
shubhamashish33 merged 1 commit into
mainfrom
fix-codeql-json-utils-escaping
May 16, 2026
Merged

Fix JSON repair escaping flagged by CodeQL#5
shubhamashish33 merged 1 commit into
mainfrom
fix-codeql-json-utils-escaping

Conversation

@shubhamashish33

Copy link
Copy Markdown
Owner

Summary

  • Replaces manual JSON string quoting in repairJSONish with JSON.stringify after normalizing supported single-quoted escape sequences.
  • Removes ad hoc bracket cleanup in getPathParents by tokenizing paths directly.
  • Adds regression tests for escaped quotes, double quotes, backslashes, newline escapes, unicode escapes, and path parent formatting.

Verification

  • npm test -- --watchAll=false src/jsonUtils.test.js
  • npm run build

Notes

This keeps existing JSON-ish repair behavior intact while avoiding incomplete string escaping/encoding patterns flagged by CodeQL.

@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
json-comparator Ready Ready Preview, Comment May 16, 2026 2:34pm

@shubhamashish33 shubhamashish33 merged commit 44e3d6e into main May 16, 2026
4 checks passed
@shubhamashish33 shubhamashish33 deleted the fix-codeql-json-utils-escaping branch May 16, 2026 14:36
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