Skip to content

Conversation

@Tednoob17
Copy link

Fixes ##1403 / suggests an improvement
This was discovered during a security audit of zx. Although Google VRP determined it doesn't meet their internal severity threshold for a 'security bug' tracking, it remains a functional flaw that allows unintended code execution. This PR resolves the parsing discrepancy.

 The transformMarkdown function fails to recognize standalone Carriage Return (\r) characters as line terminators. When processing Markdown, it incorrectly wraps text containing \r into a single JavaScript comment. Node.js, however, treats \r as a valid line break, causing any code following the \r to be executed instead of remaining commented out. This allows arbitrary code execution hidden within plain text sections of Markdown files.
The vulnerability exists because of a mismatch between the parser's logic and the JavaScript engine's (Node.js) specification.
@Tednoob17
Copy link
Author

Since this involves unintended code execution via a parsing bypass, would you be open to opening a GitHub Security Advisory for this?

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