Skip to content

Commit 40c3b54

Browse files
committed
Fix QHelp/XML syntax
1 parent c6688eb commit 40c3b54

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

java/ql/src/experimental/Security/CWE/CWE-036/OpenStream.qhelp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,34 @@
22
"-//Semmle//qhelp//EN"
33
"qhelp.dtd">
44
<qhelp>
5+
56
<overview>
67
<p>Calling <code>openStream</code> on URLs created from remote source can lead to local file disclosure.</p>
7-
88
<p>If <code>openStream</code> is called on a <code>java.net.URL</code>, that was created from a remote source
99
an attacker can try to pass absolute URLs starting with <code>file://</code> or <code>jar://</code> to access
1010
local resources in addition to remote ones.</p>
11-
1211
</overview>
13-
<recommendation>
1412

13+
<recommendation>
1514
<p>When you construct a URL using <code>java.net.URL</code> from a remote source, make sure
1615
to not call openStream on it. Instead fetch the URL with a HTTP Client to access its content.
1716
Also validate that the URL uses the correct protocol and host combination.</p>
18-
1917
</recommendation>
20-
<example>
2118

19+
<example>
2220
<p>The following example shows an URL that is constructed from a request parameter. Afterwards <code>openStream</code>
2321
is called on the URL, potentially leading to a local file access.</p>
24-
2522
<sample src="OpenStream.java" />
26-
2723
</example>
28-
<references>
2924

25+
<references>
3026
<ul>
3127
<li>Java Platform, Standard Edition 11, API Specification:
3228
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/net/URL.html">
3329
Class URL</a>.
34-
<li>
30+
</li>
3531
</ul>
36-
37-
<!-- LocalWords: CWE
38-
-->
39-
32+
<!-- LocalWords: CWE -->
4033
</references>
34+
4135
</qhelp>

0 commit comments

Comments
 (0)