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 77 <p >
88
99 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 > .
1414
1515 </p >
1616
3636
3737 <p >
3838
39- The following example code checks that a URL redirection
39+ The following example code attempts to check that a URL redirection
4040 will reach the <code >example.com</code > domain, and not
41- some malicious site.
41+ a malicious site:
4242
4343 </p >
4444
You can’t perform that action at this time.
0 commit comments