Skip to content

Commit 8a9e7eb

Browse files
Update rule metadata (#1446)
Co-authored-by: yasen-pavlov-sonarsource <yasen-pavlov-sonarsource>
1 parent 667d2c9 commit 8a9e7eb

File tree

20 files changed

+46
-50
lines changed

20 files changed

+46
-50
lines changed

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S100.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ <h3>Exceptions</h3>
3939
*/
4040
function myFunc(){...} // Compliant by exception
4141
</pre>
42-
<h2>References</h2>
42+
<h2>Resources</h2>
43+
<h3>Documentation</h3>
4344
<ul>
4445
<li> <a href="https://www.drupal.org/docs/develop/standards/php/php-coding-standards#s-functions-and-variables">Drupal - Naming Conventions -
4546
Functions and variables</a> </li>

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S1313.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p>Hardcoding IP addresses is security-sensitive. It has led in the past to the following vulnerabilities:</p>
22
<ul>
3-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5901">CVE-2006-5901</a> </li>
4-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-3725">CVE-2005-3725</a> </li>
3+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2006-5901">CVE-2006-5901</a> </li>
4+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2005-3725">CVE-2005-3725</a> </li>
55
</ul>
66
<p>Today’s services have an ever-changing architecture due to their scaling and redundancy needs. It is a mistake to think that a service will always
77
have the same IP address. When it does change, the hardcoded IP will have to be modified too. This will have an impact on the product development,

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S1523.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p>Executing code dynamically is security-sensitive. It has led in the past to the following vulnerabilities:</p>
22
<ul>
3-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9807">CVE-2017-9807</a> </li>
4-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9802">CVE-2017-9802</a> </li>
3+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2017-9807">CVE-2017-9807</a> </li>
4+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2017-9802">CVE-2017-9802</a> </li>
55
</ul>
66
<p>Some APIs enable the execution of dynamic code by providing it as strings at runtime. These APIs might be useful in some very specific
77
meta-programming use-cases. However most of the time their use is frowned upon as they also increase the risk of <a

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S1854.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h3>Exceptions</h3>
77
<p>This rule ignores initializations to <code>-1</code>, <code>0</code>, <code>1</code>, <code>null</code>, <code>true</code>, <code>false</code>,
88
<code>""</code>, <code>[]</code> and <code>array()</code>.</p>
99
<h2>How to fix it</h2>
10-
<p>Remove the unnecesarry assignment, then test the code to make sure that the right-hand side of a given assignment had no side effects (e.g. a
10+
<p>Remove the unnecessary assignment, then test the code to make sure that the right-hand side of a given assignment had no side effects (e.g. a
1111
method that writes certain data to a file and returns the number of written bytes).</p>
1212
<h3>Code examples</h3>
1313
<h4>Noncompliant code example</h4>

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S2068.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
for applications that are distributed or that are open-source.</p>
33
<p>In the past, it has led to the following vulnerabilities:</p>
44
<ul>
5-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-13466">CVE-2019-13466</a> </li>
6-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-15389">CVE-2018-15389</a> </li>
5+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2019-13466">CVE-2019-13466</a> </li>
6+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2018-15389">CVE-2018-15389</a> </li>
77
</ul>
88
<p>Credentials should be stored outside of the code in a configuration file, a database, or a management service for secrets.</p>
99
<p>This rule flags instances of hard-coded credentials used in database and LDAP connections. It looks for hard-coded credentials in connection

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S2245.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
values that must remain confidential and resistant to guessing attacks.</p>
88
<p>For example, the use of non-cryptographic PRNGs has led to vulnerabilities such as:</p>
99
<ul>
10-
<li> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-6386">CVE-2013-6386</a> </li>
11-
<li> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-3419">CVE-2006-3419</a> </li>
12-
<li> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4102">CVE-2008-4102</a> </li>
10+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2013-6386">CVE-2013-6386</a> </li>
11+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2006-3419">CVE-2006-3419</a> </li>
12+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2008-4102">CVE-2008-4102</a> </li>
1313
</ul>
1414
<p>When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that
1515
will be generated, and use this guess to impersonate another user or access sensitive information. Therefore, it is critical to use CSPRNGs in any

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S2255.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p>This rule is deprecated, and will eventually be removed.</p>
22
<p>Using cookies is security-sensitive. It has led in the past to the following vulnerabilities:</p>
33
<ul>
4-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-11639">CVE-2018-11639</a> </li>
5-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6537">CVE-2016-6537</a> </li>
4+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2018-11639">CVE-2018-11639</a> </li>
5+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2016-6537">CVE-2016-6537</a> </li>
66
</ul>
77
<p>Attackers can use widely-available tools to read cookies. Any sensitive information they may contain will be exposed.</p>
88
<p>This rule flags code that writes cookies.</p>

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S4426.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ <h2>Why is this an issue?</h2>
1616
<p>Note that depending on the algorithm, the term <strong>key</strong> refers to a different mathematical property. For example:</p>
1717
<ul>
1818
<li> For RSA, the key is the product of two large prime numbers, also called the <strong>modulus</strong>. </li>
19-
<li> For AES and Elliptic Curve Cryptography (ECC), the key is only a sequence of randomly generated bytes.
19+
<li> For Elliptic Curve Cryptography (ECC), the key is only a sequence of randomly generated bytes.
2020
<ul>
21-
<li> In some cases, AES keys are derived from a master key or a passphrase using a Key Derivation Function (KDF) like PBKDF2 (Password-Based Key
21+
<li> In some cases, keys are derived from a master key or a passphrase using a Key Derivation Function (KDF) like PBKDF2 (Password-Based Key
2222
Derivation Function 2) </li>
2323
</ul> </li>
2424
</ul>
@@ -74,11 +74,6 @@ <h4>RSA (Rivest-Shamir-Adleman) and DSA (Digital Signature Algorithm)</h4>
7474
<p>The security of these algorithms depends on the difficulty of attacks attempting to solve their underlying mathematical problem.</p>
7575
<p>In general, a minimum key size of <strong>2048</strong> bits is recommended for both. It provides 112 bits of security. A key length of
7676
<strong>3072</strong> or <strong>4096</strong> should be preferred when possible.</p>
77-
<h4>AES (Advanced Encryption Standard)</h4>
78-
<p>AES supports three key sizes: 128 bits, 192 bits and 256 bits. The security of the AES algorithm is based on the computational complexity of trying
79-
all possible keys.<br> A larger key size increases the number of possible keys and makes exhaustive search attacks computationally infeasible.
80-
Therefore, a 256-bit key provides a higher level of security than a 128-bit or 192-bit key.</p>
81-
<p>Currently, a minimum key size of <strong>128 bits</strong> is recommended for AES.</p>
8277
<h4>Elliptic Curve Cryptography (ECC)</h4>
8378
<p>Elliptic curve cryptography is also used in various algorithms, such as ECDSA, ECDH, or ECMQV. The length of keys generated with elliptic curve
8479
algorithms is mentioned directly in their names. For example, <code>secp256k1</code> generates a 256-bits long private key.</p>

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S4508.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<p>This rule is deprecated, and will eventually be removed.</p>
22
<p>Deserializing objects is security-sensitive. For example, it has led in the past to the following vulnerabilities:</p>
33
<ul>
4-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17672">CVE-2017-17672</a>: vBulletin: Unserialize PHP Code Execution </li>
5-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000167">CVE-2018-1000167</a>: Jenkins Pipeline: arbitrary code execution
6-
vulnerability </li>
4+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2017-17672">CVE-2017-17672</a>: vBulletin: Unserialize PHP Code Execution </li>
5+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2018-1000167">CVE-2018-1000167</a>: Jenkins Pipeline: arbitrary code execution vulnerability
6+
</li>
77
</ul>
88
<p>Object deserialization from an untrusted source can lead to unexpected code execution. Deserialization takes a stream of bits and turns it into an
99
object. If the stream contains the type of object you expect, all is well. But if you’re deserializing data coming from untrusted input, and an

php-checks/src/main/resources/org/sonar/l10n/php/rules/php/S4784.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<p>This rule is deprecated; use {rule:phpsecurity:S2631} instead.</p>
22
<p>Using regular expressions is security-sensitive. It has led in the past to the following vulnerabilities:</p>
33
<ul>
4-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16021">CVE-2017-16021</a> </li>
5-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-13863">CVE-2018-13863</a> </li>
6-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-8926">CVE-2018-8926</a> </li>
4+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2017-16021">CVE-2017-16021</a> </li>
5+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2018-13863">CVE-2018-13863</a> </li>
6+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2018-8926">CVE-2018-8926</a> </li>
77
</ul>
88
<p>Evaluating regular expressions against input strings is potentially an extremely CPU-intensive task. Specially crafted regular expressions such as
99
<code>/(a+)+s/</code> will take several seconds to evaluate the input string <code>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaabs</code>. The problem is that with

0 commit comments

Comments
 (0)