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

Skip to content

Commit 27d0b51

Browse files
committed
CPP & C#: Review of qhelp
PR #2151 got merged without a review of the qhelp by a technical writer. The current PR makes changes I would have suggested on that PR.
1 parent a778efe commit 27d0b51

8 files changed

Lines changed: 21 additions & 23 deletions

File tree

cpp/ql/src/Likely Bugs/Memory Management/Buffer Overflow/NtohlArrayNoBoundOpenSource.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ byte order function, such as <code>ntohl</code>.
1414
The use of a network-to-host byte order function is therefore a good indicator that the returned
1515
value is unvalidated data retrieved from the network, and should not be used without further
1616
validation. In particular, the returned value should not be used as an array index or array length
17-
value without validation, which may result in a buffer overflow vulnerability.
17+
value without validation, as this could result in a buffer overflow vulnerability.
1818
</p>
1919
</overview>
2020

cpp/ql/src/Security/CWE/CWE-457/ConditionallyUninitializedVariable.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ which is then subsequently accessed to fetch properties of the device. However,
3737
check the return value from the function call to <code>initDeviceConfig</code>. If the
3838
device number passed to the <code>notify</code> function was invalid, the
3939
<code>initDeviceConfig</code> function will leave the <code>config</code> variable uninitialized,
40-
which would result in the <code>notify</code> function accessing uninitialized memory.</p>
40+
which will result in the <code>notify</code> function accessing uninitialized memory.</p>
4141

4242
<sample src="ConditionallyUninitializedVariableBad.c" />
4343

cpp/ql/src/Security/CWE/CWE-457/ConditionallyUninitializedVariable.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @name Conditionally uninitialized variable
33
* @description When an initialization function is used to initialize a local variable, but the
44
* returned status code is not checked, the variable may be left in an uninitialized
5-
* state, and reading the variable may result in undefined behaviour.
5+
* state, and reading the variable may result in undefined behavior.
66
* @kind problem
77
* @problem.severity warning
88
* @opaque-id SM02313

csharp/ql/src/Security Features/CWE-091/XMLInjection.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ which ensures the content is appropriately escaped.</p>
3636

3737
<references>
3838
<li>
39-
<a href="http://projects.webappsec.org/w/page/13247004/XML%20Injection">XML Injection</a> (The Web Application Security Consortium).
39+
Web Application Security Consortium: <a href="http://projects.webappsec.org/w/page/13247004/XML%20Injection">XML Injection</a>.
4040
</li>
4141
<li>
42-
<a href="https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmlwriter.writeraw?view=netframework-4.8">WriteRaw</a> (Microsoft documentation).
42+
Microsoft Docs: <a href="https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmlwriter.writeraw?view=netframework-4.8">WriteRaw</a>.
4343
</li>
4444
</references>
4545
</qhelp>

csharp/ql/src/Security Features/CWE-114/AssemblyPathInjection.qhelp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ was not intended to be loaded, and executing arbitrary code.
1414
<p>
1515
Avoid loading assemblies based on user provided input. If this is not possible, ensure that the path
1616
is validated before being used with <code>Assembly</code>. For example, compare the provided input
17-
against a whitelist of known safe assemblies, or confirm that path is restricted to a single
17+
against a whitelist of known safe assemblies, or confirm that the path is restricted to a single
1818
directory which only contains safe assemblies.
1919
</p>
2020
</recommendation>
@@ -30,8 +30,8 @@ is only loaded if the user input matches one of those options.</p>
3030
</example>
3131

3232
<references>
33-
<li>
34-
<a href="https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly?view=netframework-4.8">System.Reflection.Assembly</a> (Microsoft documentation).
33+
<li>Microsoft:
34+
<a href="https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly?view=netframework-4.8">System.Reflection.Assembly</a>.
3535
</li>
3636
</references>
3737
</qhelp>

csharp/ql/src/Security Features/CWE-321/HardcodedEncryptionKey.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name Do not use hard-coded encryption keys.
3-
* @description The .Key property or rgbKey parameter of a SymmetricAlgorithm should never be a hardcoded value.
2+
* @name Hard-coded encryption key
3+
* @description The .Key property or rgbKey parameter of a SymmetricAlgorithm should never be a hard-coded value.
44
* @kind problem
55
* @id cs/hardcoded-key
66
* @problem.severity error

csharp/ql/src/Security Features/CWE-327/InsecureSQLConnection.qhelp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"qhelp.dtd">
44
<qhelp>
55
<overview>
6-
<p>Finds uses of insecure SQL Connections string by not enabling the <code>Encrypt</code> option.</p>
76

87
<p>
98
SQL Server connections where the client is not enforcing the encryption in transit are susceptible to multiple attacks, including a man-in-the-middle, that would potentially compromise the user credentials and/or the TDS session.
@@ -29,18 +28,17 @@
2928

3029
</example>
3130
<references>
32-
33-
<li>
34-
<a href="https://blogs.msdn.microsoft.com/sql_protocols/2009/10/19/selectively-using-secure-connection-to-sql-server/">Selectively using secure connection to SQL Server</a>
31+
<li>Microsoft, SQL Protocols blog:
32+
<a href="https://blogs.msdn.microsoft.com/sql_protocols/2009/10/19/selectively-using-secure-connection-to-sql-server/">Selectively using secure connection to SQL Server</a>.
33+
</li>
34+
<li>Microsoft:
35+
<a href="https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx">SqlConnection.ConnectionString Property</a>.
36+
</li>
37+
<li>Microsoft:
38+
<a href="https://msdn.microsoft.com/en-us/library/ms130822.aspx">Using Connection String Keywords with SQL Server Native Client</a>.
3539
</li>
36-
<li>
37-
<a href="https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx">Net SqlClient (ADO .Net)</a>
40+
<li>Microsoft:
41+
<a href="https://msdn.microsoft.com/en-us/library/ms378988(v=sql.110).aspx">Setting the connection properties</a>.
3842
</li>
39-
<li><a href="https://msdn.microsoft.com/en-us/library/ms130822.aspx">SQL native driver (SNAC)</a>
40-
</li>
41-
<li>
42-
<a href="https://msdn.microsoft.com/en-us/library/ms378988(v=sql.110).aspx">JDBC driver</a>
43-
</li>
44-
4543
</references>
4644
</qhelp>

csharp/ql/src/Security Features/CWE-327/InsecureSQLConnection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Insecure SQL connection
3-
* @description TODO.
3+
* @description Using an SQL Server connection without enforcing encryption is a security vulnerability.
44
* @kind path-problem
55
* @id cs/insecure-sql-connection
66
* @problem.severity error

0 commit comments

Comments
 (0)