Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Square brackets in alert messages are not rendered correctly

Open
#1,104 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
devtools, security

Research direction

Reproduce the query in a JavaScript project, then use the query history view's “View Alerts (SARIF)” entry point to inspect how the alert message is rendered. Done means the alert displays “[] test” rather than escaped brackets, while remaining valid according to the SARIF specification.

Written by the indexing model from the issue text.

Description

bug VSCode

Describe the bug
Square brackets in alert messages [ and ] are rendered as \[ and \] respectively.

Version
CodeQL extension version: 1.5.10
CodeQL CLI version: 2.7.5
Platform: darwin x64

To reproduce
Run the following query on a JavaScript (for instance) project:

/**
 * @kind alert
 */
import javascript
select any(File f), "[] test"

Right click the query in the query history view and select "View Alerts (SARIF)". Observe that the square brackets are correctly escaped as \\[ and \\] per the SARIF spec:

Literal square brackets ("[" and "]") in the link text of a plain text message SHALL be escaped with a backslash (""). Since JSON itself treats the backslash as an escape character, the backslash SHALL be doubled.

Observe that the square brackets are not correctly escaped in the alert message:

image

Expected behavior
The alert message should be "[] test"

Dominant language
TypeScript
Stars
539
Forks
240
Avg merge
2d 6h
Merged PRs (30d)
29

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/vscode-codeql

All issues in github/vscode-codeql

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.