CVE-2026-42343: Naive Json Escape Regex

Incomplete manual escaping of strings for JSON using regex replacement can lead to JSON injection or parsing errors. Use JSON.stringify instead.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0TS
greprules fetch cve-2026-42343-naive-json-escape-regex --engine opengrep

Description

Incomplete manual escaping of strings for JSON using regex replacement can lead to JSON injection or parsing errors. Use JSON.stringify instead.