Skip to content

Commit c93e08a

Browse files
Update rule metadata
1 parent 23b6ee0 commit c93e08a

File tree

18 files changed

+121
-114
lines changed

18 files changed

+121
-114
lines changed

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S2095.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ <h3>Compliant solution</h3>
6161
<h3>Exceptions</h3>
6262
<p>Instances of the following classes are ignored by this rule because <code>close</code> has no effect:</p>
6363
<ul>
64-
<li> <code>java.io.ByteArrayOutputStream</code> </li>
65-
<li> <code>java.io.ByteArrayInputStream</code> </li>
66-
<li> <code>java.io.CharArrayReader</code> </li>
67-
<li> <code>java.io.CharArrayWriter</code> </li>
68-
<li> <code>java.io.StringReader</code> </li>
69-
<li> <code>java.io.StringWriter</code> </li>
64+
<li><code>java.io.ByteArrayOutputStream</code></li>
65+
<li><code>java.io.ByteArrayInputStream</code></li>
66+
<li><code>java.io.CharArrayReader</code></li>
67+
<li><code>java.io.CharArrayWriter</code></li>
68+
<li><code>java.io.StringReader</code></li>
69+
<li><code>java.io.StringWriter</code></li>
7070
</ul>
7171
<p>Java 7 introduced the try-with-resources statement, which implicitly closes <code>Closeables</code>. All resources opened in a try-with-resources
7272
statement are ignored by this rule.</p>
@@ -80,10 +80,10 @@ <h3>Exceptions</h3>
8080
</pre>
8181
<h2>Resources</h2>
8282
<ul>
83-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/459">CWE-459 - Incomplete Cleanup</a> </li>
84-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/772">CWE-772 - Missing Release of Resource after Effective Lifetime</a> </li>
85-
<li> <a href="https://wiki.sei.cmu.edu/confluence/x/vjdGBQ">CERT, FIO04-J.</a> - Release resources when they are no longer needed </li>
86-
<li> <a href="https://wiki.sei.cmu.edu/confluence/x/QtUxBQ">CERT, FIO42-C.</a> - Close files when they are no longer needed </li>
87-
<li> <a href="https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html">Try With Resources</a> </li>
83+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/459">CWE-459 - Incomplete Cleanup</a></li>
84+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/772">CWE-772 - Missing Release of Resource after Effective Lifetime</a></li>
85+
<li><a href="https://wiki.sei.cmu.edu/confluence/x/vjdGBQ">CERT, FIO04-J.</a> - Release resources when they are no longer needed</li>
86+
<li><a href="https://wiki.sei.cmu.edu/confluence/x/QtUxBQ">CERT, FIO42-C.</a> - Close files when they are no longer needed</li>
87+
<li><a href="https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html">Try With Resources</a></li>
8888
</ul>
8989

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S2189.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ <h3>Compliant solution</h3>
4141
<h2>Resources</h2>
4242
<h3>Standards</h3>
4343
<ul>
44-
<li> <a href="https://wiki.sei.cmu.edu/confluence/x/lzZGBQ">CERT, MSC01-J.</a> - Do not use an empty infinite loop </li>
44+
<li><a href="https://wiki.sei.cmu.edu/confluence/x/lzZGBQ">CERT, MSC01-J.</a> - Do not use an empty infinite loop</li>
4545
</ul>
4646

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S2222.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ <h3>Compliant solution</h3>
2929
</pre>
3030
<h2>Resources</h2>
3131
<ul>
32-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/459">CWE-459 - Incomplete Cleanup</a> </li>
32+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/459">CWE-459 - Incomplete Cleanup</a></li>
3333
</ul>
3434

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S2583.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h3>Noncompliant code example</h3>
1717
<h3>Exceptions</h3>
1818
<p>This rule will not raise an issue in either of these cases:</p>
1919
<ul>
20-
<li> When the condition is a single <code>final boolean</code> </li>
20+
<li>When the condition is a single <code>final boolean</code></li>
2121
</ul>
2222
<pre>
2323
final boolean debug = false;
@@ -27,7 +27,7 @@ <h3>Exceptions</h3>
2727
}
2828
</pre>
2929
<ul>
30-
<li> When the condition is literally <code>true</code> or <code>false</code>. </li>
30+
<li>When the condition is literally <code>true</code> or <code>false</code>.</li>
3131
</ul>
3232
<pre>
3333
if (true) {
@@ -37,9 +37,8 @@ <h3>Exceptions</h3>
3737
<p>In these cases it is obvious the code is as intended.</p>
3838
<h2>Resources</h2>
3939
<ul>
40-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/570">CWE-570 - Expression is Always False</a> </li>
41-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/571">CWE-571 - Expression is Always True</a> </li>
42-
<li> <a href="https://wiki.sei.cmu.edu/confluence/x/5dUxBQ">CERT, MSC12-C.</a> - Detect and remove code that has no effect or is never executed
43-
</li>
40+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/570">CWE-570 - Expression is Always False</a></li>
41+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/571">CWE-571 - Expression is Always True</a></li>
42+
<li><a href="https://wiki.sei.cmu.edu/confluence/x/5dUxBQ">CERT, MSC12-C.</a> - Detect and remove code that has no effect or is never executed</li>
4443
</ul>
4544

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S2589.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h4>Compliant solution</h4>
6666
<h2>Resources</h2>
6767
<h3>Articles &amp; blog posts</h3>
6868
<ul>
69-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/571">CWE-571 - Expression is Always True</a> </li>
70-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/570">CWE-570 - Expression is Always False</a> </li>
69+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/571">CWE-571 - Expression is Always True</a></li>
70+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/570">CWE-570 - Expression is Always False</a></li>
7171
</ul>
7272

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S2637.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ <h3>Noncompliant code example</h3>
2929
<h2>Resources</h2>
3030
<h3>Standards</h3>
3131
<ul>
32-
<li> CERT - <a href="https://wiki.sei.cmu.edu/confluence/x/QdcxBQ">EXP34-C. Do not dereference null pointers</a> </li>
33-
<li> CERT - <a href="https://wiki.sei.cmu.edu/confluence/display/java/EXP01-J.+Do+not+use+a+null+in+a+case+where+an+object+is+required">EXP01-J. Do
34-
not use a null in a case where an object is required</a> </li>
35-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/476">CWE-476 NULL Pointer Dereference</a> </li>
32+
<li>CERT - <a href="https://wiki.sei.cmu.edu/confluence/x/QdcxBQ">EXP34-C. Do not dereference null pointers</a></li>
33+
<li>CERT - <a href="https://wiki.sei.cmu.edu/confluence/display/java/EXP01-J.+Do+not+use+a+null+in+a+case+where+an+object+is+required">EXP01-J. Do
34+
not use a null in a case where an object is required</a></li>
35+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/476">CWE-476 NULL Pointer Dereference</a></li>
3636
</ul>
3737

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S2689.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ <h4>Compliant solution</h4>
2323
<h2>Resources</h2>
2424
<h3>Articles &amp; blog posts</h3>
2525
<ul>
26-
<li> <a href="https://docs.jboss.org/jbossas/javadoc/4.0.2/org/jboss/util/stream/AppendingObjectOutputStream.java.html">JBoss -
27-
AppendingObjectOutputStream</a> </li>
26+
<li><a href="https://docs.jboss.org/jbossas/javadoc/4.0.2/org/jboss/util/stream/AppendingObjectOutputStream.java.html">JBoss -
27+
AppendingObjectOutputStream</a></li>
2828
</ul>
2929
<h3>Documentation</h3>
3030
<ul>
31-
<li> <a href="https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/io/ObjectOutputStream.html">Oracle SE 20 - ObjectOutputStream</a>
32-
</li>
31+
<li><a href="https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/io/ObjectOutputStream.html">Oracle SE 20 -
32+
ObjectOutputStream</a></li>
3333
</ul>
3434

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S2755.html

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ <h4>Disable external entities</h4>
6666
appropriate properties or options in your XML parser library or framework.</p>
6767
<p>If external entity processing is necessary for certain scenarios, adopt a whitelisting approach to restrict the entities that can be resolved
6868
during XML parsing. Create a list of trusted external entities and disallow all others. This approach ensures that only known and safe entities are
69-
processed.<br> You should rely on features provided by your XML parser to restrict the external entities.</p>
69+
processed.
70+
<br>
71+
You should rely on features provided by your XML parser to restrict the external entities.</p>
7072
<h3>Going the extra mile</h3>
7173
<h4>Disable entity expansion</h4>
7274
<p>Specifically for <code>DocumentBuilderFactory</code>, it is possible to disable the entity expansion. Note, however, that this does not prevent the
@@ -102,7 +104,9 @@ <h4>Disable external entities</h4>
102104
appropriate properties or options in your XML parser library or framework.</p>
103105
<p>If external entity processing is necessary for certain scenarios, adopt a whitelisting approach to restrict the entities that can be resolved
104106
during XML parsing. Create a list of trusted external entities and disallow all others. This approach ensures that only known and safe entities are
105-
processed.<br> You should rely on features provided by your XML parser to restrict the external entities.</p>
107+
processed.
108+
<br>
109+
You should rely on features provided by your XML parser to restrict the external entities.</p>
106110
<h2>How to fix it in Jdom2</h2>
107111
<h3>Code examples</h3>
108112
<p>The following code contains examples of XML parsers that have external entity processing enabled. As a result, the parsers are vulnerable to XXE
@@ -131,7 +135,9 @@ <h4>Disable external entities</h4>
131135
appropriate properties or options in your XML parser library or framework.</p>
132136
<p>If external entity processing is necessary for certain scenarios, adopt a whitelisting approach to restrict the entities that can be resolved
133137
during XML parsing. Create a list of trusted external entities and disallow all others. This approach ensures that only known and safe entities are
134-
processed.<br> You should rely on features provided by your XML parser to restrict the external entities.</p>
138+
processed.
139+
<br>
140+
You should rely on features provided by your XML parser to restrict the external entities.</p>
135141
<h2>How to fix it in SAX</h2>
136142
<h3>Code examples</h3>
137143
<p>The following code contains examples of XML parsers that have external entity processing enabled. As a result, the parsers are vulnerable to XXE
@@ -163,20 +169,22 @@ <h4>Disable external entities</h4>
163169
appropriate properties or options in your XML parser library or framework.</p>
164170
<p>If external entity processing is necessary for certain scenarios, adopt a whitelisting approach to restrict the entities that can be resolved
165171
during XML parsing. Create a list of trusted external entities and disallow all others. This approach ensures that only known and safe entities are
166-
processed.<br> You should rely on features provided by your XML parser to restrict the external entities.</p>
172+
processed.
173+
<br>
174+
You should rely on features provided by your XML parser to restrict the external entities.</p>
167175
<h2>Resources</h2>
168176
<h3>Standards</h3>
169177
<ul>
170-
<li> OWASP - <a href="https://owasp.org/Top10/A05_2021-Security_Misconfiguration/">Top 10 2021 Category A5 - Security Misconfiguration</a> </li>
171-
<li> OWASP - <a href="https://owasp.org/www-project-top-ten/2017/A4_2017-XML_External_Entities_(XXE)">Top 10 2017 Category A4 - XML External
172-
Entities (XXE)</a> </li>
173-
<li> OWASP - <a href="https://owasp.org/www-project-mobile-top-10/2023-risks/m4-insufficient-input-output-validation">Mobile Top 10 2024 Category M4
174-
- Insufficient Input/Output Validation</a> </li>
175-
<li> OWASP - <a href="https://owasp.org/www-project-mobile-top-10/2023-risks/m8-security-misconfiguration">Mobile Top 10 2024 Category M8 - Security
176-
Misconfiguration</a> </li>
177-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/611">CWE-611 - Information Exposure Through XML External Entity Reference</a> </li>
178-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/827">CWE-827 - Improper Control of Document Type Definition</a> </li>
179-
<li> STIG Viewer - <a href="https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222608">Application Security and
180-
Development: V-222608</a> - The application must not be vulnerable to XML-oriented attacks. </li>
178+
<li>OWASP - <a href="https://owasp.org/Top10/A05_2021-Security_Misconfiguration/">Top 10 2021 Category A5 - Security Misconfiguration</a></li>
179+
<li>OWASP - <a href="https://owasp.org/www-project-top-ten/2017/A4_2017-XML_External_Entities_(XXE)">Top 10 2017 Category A4 - XML External Entities
180+
(XXE)</a></li>
181+
<li>OWASP - <a href="https://owasp.org/www-project-mobile-top-10/2023-risks/m4-insufficient-input-output-validation">Mobile Top 10 2024 Category M4
182+
- Insufficient Input/Output Validation</a></li>
183+
<li>OWASP - <a href="https://owasp.org/www-project-mobile-top-10/2023-risks/m8-security-misconfiguration">Mobile Top 10 2024 Category M8 - Security
184+
Misconfiguration</a></li>
185+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/611">CWE-611 - Information Exposure Through XML External Entity Reference</a></li>
186+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/827">CWE-827 - Improper Control of Document Type Definition</a></li>
187+
<li>STIG Viewer - <a href="https://stigviewer.com/stigs/application_security_and_development/2024-12-06/finding/V-222608">Application Security and
188+
Development: V-222608</a> - The application must not be vulnerable to XML-oriented attacks.</li>
181189
</ul>
182190

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S3546.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ <h2>Why is this an issue?</h2>
55
<h2>Resources</h2>
66
<h3>Related rules</h3>
77
<ul>
8-
<li> {rule:java:S2095} - Resources should be closed </li>
8+
<li>{rule:java:S2095} - Resources should be closed</li>
99
</ul>
1010

java-symbolic-execution/java-symbolic-execution-plugin/src/main/resources/org/sonar/l10n/java/rules/javase/S3655.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ <h3>Compliant solution</h3>
5252
</pre>
5353
<h2>Resources</h2>
5454
<ul>
55-
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/476">CWE-476 - NULL Pointer Dereference</a> </li>
55+
<li>CWE - <a href="https://cwe.mitre.org/data/definitions/476">CWE-476 - NULL Pointer Dereference</a></li>
5656
</ul>
5757

0 commit comments

Comments
 (0)