File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
swift/ql/src/queries/Security/CWE-020 Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 7
7
<p >
8
8
9
9
Sanitizing untrusted input with regular expressions is a
10
- common technique. However, it is error-prone to match untrusted input
11
- against regular expressions without anchors such as < code >^</ code > or
12
- < code >$</ code >. Malicious input can bypass such security checks by
13
- embedding one of the allowed patterns in an unexpected location .
10
+ common technique, but malicious actors may be able to embed one of the
11
+ allowed patterns in an unexpected location. To prevent against this,
12
+ you should use anchors in your regular expressions,
13
+ such as < code >^</ code > or < code >$</ code > .
14
14
15
15
</p >
16
16
36
36
37
37
<p >
38
38
39
- The following example code checks that a URL redirection
39
+ The following example code attempts to check that a URL redirection
40
40
will reach the <code >example.com</code > domain, and not
41
- some malicious site.
41
+ a malicious site:
42
42
43
43
</p >
44
44
You can’t perform that action at this time.
0 commit comments