mirror of
https://github.com/github/codeql.git
synced 2026-04-22 23:35:14 +02:00
Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
This commit is contained in:
@@ -41,12 +41,12 @@ such as "/etc/passwd".</p>
|
||||
<sample src="TaintedPath.java" />
|
||||
|
||||
<p>Simply checking that the path is under a trusted location (such as a known public folder) is not enough,
|
||||
however, since the path could contain relative components such as "..". To fix this, we check that the it does
|
||||
however, since the path could contain relative components such as "..". To fix this, check that it does
|
||||
not contain ".." and starts with the public folder.</p>
|
||||
|
||||
<sample src="TaintedPathGood.java" />
|
||||
|
||||
<p>Alternatively, if we only want to allow simple filenames without a path component, we can remove all path
|
||||
<p>Alternatively, if you only want to allow simple filenames without a path component, you can remove all path
|
||||
separators ("/" or "\") and all ".." sequences from the input before using it to construct a file path.</p>
|
||||
|
||||
<sample src="TaintedPathGood2.java" />
|
||||
|
||||
Reference in New Issue
Block a user