Skip to content

Commit d2b18d9

Browse files
committed
C++: Add qhelp.
1 parent bd1e708 commit d2b18d9

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
void openUrl(char *url)
3+
{
4+
// ...
5+
}
6+
7+
openUrl("http://example.com"); // BAD
8+
9+
openUrl("https://example.com"); // GOOD: Opening a connection to a URL using HTTPS enforces SSL.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE qhelp PUBLIC
2+
"-//Semmle//qhelp//EN"
3+
"qhelp.dtd">
4+
<qhelp>
5+
<overview>
6+
7+
<p>Constructing URLs with the HTTP protocol can lead to unsecured connections.</p>
8+
9+
</overview>
10+
<recommendation>
11+
12+
<p>When you construct a URL, ensure that you use an HTTPS URL rather than an HTTP URL. Then, any connections that are made using that URL are secure SSL connections.</p>
13+
14+
</recommendation>
15+
<example>
16+
17+
<p>The following example shows two ways of opening a connection using a URL. When the connection is
18+
opened using an HTTP URL rather than an HTTPS URL, the connection is unsecured. When the connection is opened using an HTTPS URL, the connection is a secure SSL connection.</p>
19+
20+
<sample src="HttpsUrls.cpp" />
21+
22+
</example>
23+
<references>
24+
25+
<li>
26+
OWASP:
27+
<a href="https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Protection_Cheat_Sheet.html">Transport Layer Protection Cheat Sheet</a>.
28+
</li>
29+
<li>
30+
OWASP Top 10:
31+
<a href="https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/">A08:2021 – Software and Data Integrity Failures</a>.
32+
</li>
33+
34+
</references>
35+
</qhelp>

0 commit comments

Comments
 (0)