Skip to content

Commit 58b5bd5

Browse files
committed
JS: fixup documentation
1 parent f0a05f6 commit 58b5bd5

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

javascript/ql/src/Security/CWE-116/IncompleteHtmlAttributeSanitization.qhelp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@
3030

3131
<recommendation>
3232

33-
Sanitize all relevant HTML meta-characters when constructing
34-
HTML dynamically, pay special attention to where the sanitized value is used.
33+
<p>
34+
35+
Sanitize all relevant HTML meta-characters when
36+
constructing HTML dynamically, and pay special attention to where the
37+
sanitized value is used.
38+
39+
</p>
3540

3641
</recommendation>
3742

@@ -75,8 +80,7 @@
7580
</li>
7681
<li>
7782
OWASP
78-
<a href="https://www.owasp.org/index.php/Types_of_Cross-Site_Scripting">Types of Cross-Site
79-
Scripting</a>.
83+
<a href="https://owasp.org/www-community/Types_of_Cross-Site_Scripting">Types of Cross-Site</a>.
8084
</li>
8185
<li>
8286
Wikipedia: <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">Cross-site scripting</a>.

javascript/ql/src/Security/CWE-116/IncompleteHtmlAttributeSanitization.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @name Incomplete HTML attribute sanitization
33
* @description Writing incompletely sanitized values to HTML
4-
* attribute strings can lead to a cross-site
4+
* attribute strings can lead to a cross-site
55
* scripting vulnerability.
66
* @kind path-problem
77
* @problem.severity warning

javascript/ql/src/Security/CWE-116/examples/IncompleteHtmlAttributeSanitization.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var app = require('express')();
33
app.get('/user/:id', function(req, res) {
44
let id = req.params.id;
55
id = id.replace(/<|>/g, ""); // BAD
6-
let userHtml = `<div data-id="${id}">${getUserName(id)} || Unknown name</div>`;
6+
let userHtml = `<div data-id="${id}">${getUserName(id) || "Unknown name"}</div>`;
77
// ...
88
res.send(prefix + userHtml + suffix);
99
});

javascript/ql/src/Security/CWE-116/examples/IncompleteHtmlAttributeSanitizationGood.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var app = require('express')();
33
app.get('/user/:id', function(req, res) {
44
let id = req.params.id;
55
id = id.replace(/<|>|&|"/g, ""); // GOOD
6-
let userHtml = `<div data-id="${id}">${getUserName(id)} || Unknown name</div>`;
6+
let userHtml = `<div data-id="${id}">${getUserName(id) || "Unknown name"}</div>`;
77
// ...
88
res.send(prefix + userHtml + suffix);
99
});

0 commit comments

Comments
 (0)