Skip to content

Commit 3496ae1

Browse files
committed
JS: Factor out <recommendation> part of qhelp
1 parent 8ac0ec8 commit 3496ae1

File tree

3 files changed

+27
-36
lines changed

3 files changed

+27
-36
lines changed

javascript/ql/src/Security/CWE-918/ClientSideRequestForgery.qhelp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,7 @@
1919
</p>
2020
</overview>
2121

22-
<recommendation>
23-
24-
<p>
25-
Restrict user inputs in the URL of an outgoing request, in particular:
26-
<ul>
27-
<li>
28-
Avoid user input in the hostname of the URL.
29-
Pick the hostname from an allow-list instead of constructing it directly from user input.
30-
</li>
31-
<li>
32-
Take care when user input is part of the pathname of the URL.
33-
Restrict the input so that path traversal ("<code>../<code>")
34-
cannot be used to redirect the request to an unintended endpoint.
35-
</li>
36-
</ul>
37-
</p>
38-
39-
</recommendation>
22+
<include src="RequestForgeryRecommendation.inc.qhelp"/>
4023

4124
<example>
4225

javascript/ql/src/Security/CWE-918/RequestForgery.qhelp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,7 @@
2020
</p>
2121
</overview>
2222

23-
<recommendation>
24-
25-
<p>
26-
Restrict user inputs in the URL of an outgoing request, in particular:
27-
<ul>
28-
<li>
29-
Avoid user input in the hostname of the URL.
30-
Pick the hostname from an allow-list instead of constructing it directly from user input.
31-
</li>
32-
<li>
33-
Take care when user input is part of the pathname of the URL.
34-
Restrict the input so that path traversal ("<code>../<code>")
35-
cannot be used to redirect the request to an unintended endpoint.
36-
</li>
37-
</ul>
38-
</p>
39-
40-
</recommendation>
23+
<include src="RequestForgeryRecommendation.inc.qhelp"/>
4124

4225
<example>
4326

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE qhelp PUBLIC
2+
"-//Semmle//qhelp//EN"
3+
"qhelp.dtd">
4+
<qhelp>
5+
6+
<recommendation>
7+
8+
<p>
9+
Restrict user inputs in the URL of an outgoing request, in particular:
10+
</p>
11+
<ul>
12+
<li>
13+
Avoid user input in the hostname of the URL.
14+
Pick the hostname from an allow-list instead of constructing it directly from user input.
15+
</li>
16+
<li>
17+
Take care when user input is part of the pathname of the URL.
18+
Restrict the input so that path traversal ("<code>../</code>")
19+
cannot be used to redirect the request to an unintended endpoint.
20+
</li>
21+
</ul>
22+
23+
</recommendation>
24+
25+
</qhelp>

0 commit comments

Comments
 (0)