Skip to content

Commit 2ca0b0c

Browse files
committed
Inline qhelp overview
A <p> at the top isn't allowed, and for some reason the inclusion is required to be a valid qhelp file.
1 parent cf68a11 commit 2ca0b0c

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"qhelp.dtd">
44
<qhelp>
55
<overview>
6-
<include src="PartialPathTraversalOverview.inc.qhelp"/>
6+
<p>A common way to check that a user-supplied path <code>SUBDIR</code> falls inside a directory <code>DIR</code>
7+
is to use <code>getCanonicalPath()</code> to remove any path-traversal elements and then check that <code>DIR</code>
8+
is a prefix. However, if <code>DIR</code> is not slash-terminated, this can unexpectedly allow accessing siblings of <code>DIR</code>.</p>
9+
710
<p>See also <code>java/partial-path-traversal-from-remote</code>, which is similar to this query but only flags instances with evidence of remote exploitability</p>
811
</overview>
912

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"qhelp.dtd">
44
<qhelp>
55
<overview>
6-
<include src="PartialPathTraversalOverview.inc.qhelp"/>
6+
<p>A common way to check that a user-supplied path <code>SUBDIR</code> falls inside a directory <code>DIR</code>
7+
is to use <code>getCanonicalPath()</code> to remove any path-traversal elements and then check that <code>DIR</code>
8+
is a prefix. However, if <code>DIR</code> is not slash-terminated, this can unexpectedly allow accessing siblings of <code>DIR</code>.</p>
9+
710
<p>See also <code>java/partial-path-traversal</code>, which is similar to this query,
811
but may also flag non-remotely-exploitable instances of Partial Path Traversal.</p>
912
</overview>

java/ql/src/Security/CWE/CWE-023/PartialPathTraversalOverview.inc.qhelp

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)