Skip to content

Commit 0bf9529

Browse files
authored
Merge pull request github#1726 from xiemaisi/js/help-fixes
Approved by esben-semmle
2 parents e890aba + 020d31c commit 0bf9529

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

javascript/ql/src/Security/CWE-020/MissingRegExpAnchor.qhelp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@
4747
<p>
4848

4949
The check with the regular expression match is, however, easy to bypass. For example
50-
by embedding <code>example.com</code> in the path component:
51-
<code>http://evil-example.net/example.com</code>, or in the query
52-
string component: <code>http://evil-example.net/?x=example.com</code>.
50+
by embedding <code>http://example.com/</code> in the query
51+
string component: <code>http://evil-example.net/?x=http://example.com/</code>.
5352

5453
Address these shortcomings by using anchors in the regular expression instead:
5554

javascript/ql/src/Security/CWE-022/TaintedPath.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ However, a malicious user could enter a file name which is an absolute path, suc
4141
In the second example, it appears that the user is restricted to opening a file within the
4242
<code>"user"</code> home directory. However, a malicious user could enter a file name containing
4343
special characters. For example, the string <code>"../../etc/passwd"</code> will result in the code
44-
reading the file located at <code>"/home/[user]/../../etc/passwd"</code>, which is the system's
44+
reading the file located at <code>"/home/user/../../etc/passwd"</code>, which is the system's
4545
password file. This file would then be sent back to the user, giving them access to all the
4646
system's passwords.
4747
</p>

0 commit comments

Comments
 (0)