You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I tested this with the VS Code extension, but I assume the underlying issue is in the CodeQL CLI)
Description
Backslashes (\) in the query message are apparently not properly escaped in SARIF. This causes for example issues when viewing the alerts in the VS Code extension.
This seems to affect
the main message, e.g.: select t, "message: \\$@", t, "link"
becomes "text" : "message: \\[link](1)" (should be \\\\[ in JSON)
placeholder messages, e.g.: select t, "message: $@", t, "link\\"
becomes "text" : "message: [link\\](1)" (should be \\\\] in JSON)
Run the following Java query in VS Code (either on a local database or with variant analysis)
/** * @kind problem */import java
fromTopLevelClasstwheret.fromSource()selectt,"message: $@",t,["1","\\2","3\\","4\\\\","5[","6]","7\\[","8\\]"]
Have a look at the rendered results
❌ Bug: It contains multiple malformed results
In the "Query History", right click the query execution and select "View Alerts (SARIF)"
❌ Bug: You will see in the SARIF data that the \ has not been properly escaped in the embedded links in "text"
The text was updated successfully, but these errors were encountered:
Version
(I tested this with the VS Code extension, but I assume the underlying issue is in the CodeQL CLI)
Description
Backslashes (
\
) in the query message are apparently not properly escaped in SARIF. This causes for example issues when viewing the alerts in the VS Code extension.This seems to affect
select t, "message: \\$@", t, "link"
becomes
"text" : "message: \\[link](1)"
(should be\\\\[
in JSON)select t, "message: $@", t, "link\\"
becomes
"text" : "message: [link\\](1)"
(should be\\\\]
in JSON)See also SARIF spec 2.1.0 §3.11.6 Messages with embedded links.
How to reproduce
❌ Bug: It contains multiple malformed results
❌ Bug: You will see in the SARIF data that the
\
has not been properly escaped in the embedded links in"text"
The text was updated successfully, but these errors were encountered: