Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ebe48ec

Browse files
Update java/ql/src/Security/CWE/CWE-023/PartialPathTraversal.qhelp
Co-authored-by: Jonathan Leitschuh <[email protected]>
1 parent 48e16e5 commit ebe48ec

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

java/ql/src/Security/CWE/CWE-023/PartialPathTraversal.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
is meant to access files under a certain directory but does not enters a path under that directory, they can gain access to
88
(and potentially modify/delete) unexpected, possibly sensitive resources. </p>
99

10-
<p> Suppose a program is to only accept paths that point to files/folders within directory <code>DIR</code>.
11-
To ensure that a user inputted path, say <code>SUBDIR</code>, is a subdirectory of <code>DIR</code>, the
12-
program verifies that <code>DIR</code> is a prefix of <code>SUBDIR</code>.
13-
However, this check is not satisfactory: unless <code>DIR</code> is not slash-terminated,
10+
<p>Suppose a program is to only accept paths that point to files/folders within directory <code>DIR</code>.
11+
To ensure that a user supplied path, say <code>SUBDIR</code>, is a subdirectory of <code>DIR</code>, the
12+
program verifies, using string comparisons, that <code>DIR</code> is a prefix of <code>SUBDIR</code>.
13+
However, if <code>DIR</code> is not slash-terminated, such a check would not be sufficient.
1414
<code>SUBDIR</code> may be allowed to also access siblings of <code>DIR</code> and not
15-
just children of <code>DIR</code>, which is a security issue. </p>
15+
just children of <code>DIR</code>, which is a security vulnerability.</p>
1616

1717
</overview>
1818
<recommendation>

0 commit comments

Comments
 (0)