CodeQL queries 1.24
Directly writing user input (for example, a URL query parameter) to a webpage without properly sanitizing the input first, allows for a cross-site scripting vulnerability.
This kind of vulnerability is also called DOM-based cross-site scripting, to distinguish it from other types of cross-site scripting.
To guard against cross-site scripting, consider using contextual output encoding/escaping before writing user input to the page, or one of the other solutions that are mentioned in the references.
The following example shows part of the page URL being written directly to the document, leaving the website vulnerable to cross-site scripting.