File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
javascript/ql/src/Security/CWE-601 Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,19 @@ before doing the redirection:
3838<sample src =" examples/ServerSideUrlRedirectGood.js" />
3939
4040<p >
41- Alternatively, we can check that the target URL does not redirect to a different host:
41+ Alternatively, we can check that the target URL does not redirect to a different host
42+ by parsing it relative to a base URL with a known host and verifying that the host
43+ stays the same:
4244</p >
4345
4446<sample src =" examples/ServerSideUrlRedirectGood2.js" />
4547
48+ <p >
49+ Note that as written, the above code will allow redirects to URLs on <code >example.com</code >,
50+ which is harmless but perhaps not intended. Substitute your own domain name for
51+ <code >example.com</code > to prevent this.
52+ </p >
53+
4654</example >
4755
4856<references >
You can’t perform that action at this time.
0 commit comments