Skip to content

Commit b8d676a

Browse files
authored
Update rule metadata and parent POM version (#4755)
1 parent b49599b commit b8d676a

20 files changed

Lines changed: 36 additions & 38 deletions

File tree

its/autoscan/src/test/resources/autoscan/diffs/diff_S2647.json

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

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.sonarsource.parent</groupId>
77
<artifactId>parent</artifactId>
8-
<version>71.0.0.1292</version>
8+
<version>71.0.0.1314</version>
99
</parent>
1010

1111
<groupId>org.sonarsource.java</groupId>

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S1153.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
"ruleSpecification": "RSPEC-1153",
2020
"sqKey": "S1153",
2121
"scope": "All",
22-
"quickfix": "targeted"
22+
"quickfix": "covered"
2323
}

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S2647.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<p>This rule is deprecated, and will eventually be removed.</p>
12
<p>Basic authentication is a vulnerable method of user authentication that should be avoided. It functions by transmitting a Base64 encoded username
23
and password. As Base64 is easy to recognize and reverse, sensitive data may be leaked this way.</p>
34
<h2>Why is this an issue?</h2>

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S2647.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77
},
88
"attribute": "TRUSTWORTHY"
99
},
10-
"status": "ready",
10+
"status": "deprecated",
1111
"remediation": {
1212
"func": "Constant\/Issue",
1313
"constantCost": "2h"
1414
},
15-
"tags": [
16-
"cwe"
17-
],
15+
"tags": [],
1816
"defaultSeverity": "Critical",
1917
"ruleSpecification": "RSPEC-2647",
2018
"sqKey": "S2647",

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S4347.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
<p>When using <code>SecureRandom</code>, it is important not to use predictable seeds. This class is used to generate cryptographically strong random
2-
numbers. Using a predictable seed will make its output predictable as well, which counteracts the use case of <code>SecureRandom</code>.</p>
1+
<p>Cryptographic operations often rely on unpredictable random numbers to enhance security. These random numbers are created by cryptographically
2+
secure pseudo-random number generators (CSPRNG). It is important not to use a predictable seed with these random number generators otherwise the
3+
random numbers will also become predictable.</p>
34
<h2>Why is this an issue?</h2>
4-
<p><code>java.security.SecureRandom</code> is often used to generate random values for cryptographic algorithms. When a random number generator is
5-
used for cryptographic purposes, the generated numbers must be as random and unpredictable as possible. When <code>SecureRandom</code> is improperly
6-
seeded with a constant or a predictable value, its output will also be predictable.</p>
5+
<p>Random number generators are often used to generate random values for cryptographic algorithms. When a random number generator is used for
6+
cryptographic purposes, the generated numbers must be as random and unpredictable as possible. When the random number generator is improperly seeded
7+
with a constant or a predictable value, its output will also be predictable.</p>
78
<p>This can have severe security implications for cryptographic operations that rely on the randomness of the generated numbers. By using a
89
predictable seed, an attacker can potentially guess or deduce the generated numbers, compromising the security of whatever cryptographic algorithm
9-
relies on <code>SecureRandom</code>.</p>
10+
relies on the random number generator.</p>
1011
<h3>What is the potential impact?</h3>
1112
<p>It is crucial to understand that the strength of cryptographic algorithms heavily relies on the quality of the random numbers used. By improperly
12-
seeding the <code>SecureRandom</code> class, we introduce a significant weakness that can be exploited by attackers.</p>
13+
seeding a CSPRNG, we introduce a significant weakness that can be exploited by attackers.</p>
1314
<h4>Insecure cryptographic keys</h4>
14-
<p>One of the primary use cases for the <code>SecureRandom</code> class is generating cryptographic keys. If an attacker can predict the seed used to
15-
initialize the SecureRandom instance, they may be able to derive the same keys. Depending on the use case, this can lead to multiple severe outcomes,
16-
such as:</p>
15+
<p>One of the primary use cases for CSPRNGs is generating cryptographic keys. If an attacker can predict the seed used to initialize the random number
16+
generator, they may be able to derive the same keys. Depending on the use case, this can lead to multiple severe outcomes, such as:</p>
1717
<ul>
1818
<li> Being able to decrypt sensitive documents, leading to privacy breaches or identity theft. </li>
1919
<li> Gaining access to a private key used for signing, allowing an attacker to forge digital signatures and impersonate legitimate entities. </li>

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S4347.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"title": "\"SecureRandom\" seeds should not be predictable",
2+
"title": "Secure random number generators should not output predictable values",
33
"type": "VULNERABILITY",
44
"code": {
55
"impacts": {

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S5194.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h2>Why is this an issue?</h2>
22
<p>Many existing switch statements are essentially simulations of switch expressions, where each arm either assigns to a common target variable or
33
returns a value. Expressing this as a statement is roundabout, repetitive, and error-prone.</p>
4-
<p>Java 12 added support for switch expressions, which provide more succinct and less error-prone version of switch.</p>
4+
<p>Java 14 added support for switch expressions, which provide more succinct and less error-prone version of switch.</p>
55
<h3>Noncompliant code example</h3>
66
<pre>
77
void day_of_week(DoW day) {

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S5194.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"title": "Use Java 12 \"switch\" expression",
2+
"title": "Use Java 14 \"switch\" expression",
33
"type": "CODE_SMELL",
44
"code": {
55
"impacts": {
@@ -13,7 +13,7 @@
1313
"constantCost": "5min"
1414
},
1515
"tags": [
16-
"java12"
16+
"java14"
1717
],
1818
"defaultSeverity": "Minor",
1919
"ruleSpecification": "RSPEC-5194",

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S6816.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h2>Why is this an issue?</h2>
44
<p>The <code>@Value</code> annotation does not guarantee that the property is defined. Particularly if a field or parameter is annotated as nullable,
55
it indicates that the developer assumes that the property may be undefined.</p>
6-
<p>An undefined property may lead to a runtime exceptions when the Spring framework tries to inject the autowired dependency during bean creation.</p>
6+
<p>An undefined property may lead to runtime exceptions when the Spring framework tries to inject the autowired dependency during bean creation.</p>
77
<p>This rule raises an issue when a nullable field or parameter is annotated with <code>@Value</code> and no default value is provided.</p>
88
<h2>How to fix it</h2>
99
<p>Add a default value to the <code>@Value</code> annotation. A default value can be supplied by using the colon (<code>:</code>) operator. As the

0 commit comments

Comments
 (0)