Skip to content

Commit 0ca64ef

Browse files
update metadata for 3.4.1 (#908)
1 parent 18ebdb2 commit 0ca64ef

File tree

14 files changed

+40
-34
lines changed

14 files changed

+40
-34
lines changed

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S2053.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"defaultSeverity": "Critical",
1515
"ruleSpecification": "RSPEC-2053",
1616
"sqKey": "S2053",
17-
"scope": "All",
17+
"scope": "Main",
1818
"securityStandards": {
1919
"CWE": [
2020
759,

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S2092.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<h2>Ask Yourself Whether</h2>
44
<ul>
55
<li> the cookie is for instance a <em>session-cookie</em> not designed to be sent over non-HTTPS communication. </li>
6-
<li> it's not sure that the website contains <a href="https://developer.mozilla.org/fr/docs/Web/Security/Mixed_content">mixed content</a> or not (ie
7-
HTTPS everywhere or not) </li>
6+
<li> it's not sure that the website contains <a href="https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content">mixed content</a> or not
7+
(ie HTTPS everywhere or not) </li>
88
</ul>
99
<p>There is a risk if you answered yes to any of those questions.</p>
1010
<h2>Recommended Secure Coding Practices</h2>

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S3329.html

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
<p>In encryption, when Cipher Block Chaining (CBC) is used, the Initialization Vector (IV) must be random and unpredictable. Otherwise, the encrypted
2-
value is vulnerable to crypto-analysis attacks such as the "Chosen-Plaintext Attack".</p>
3-
<p>An IV value should be associated to one, and only one encryption cycle, because the IV's purpose is to ensure that the same plaintext encrypted
4-
twice will yield two different ciphertexts.</p>
5-
<p>To that end, IV's should be:</p>
6-
<ul>
7-
<li> random </li>
8-
<li> unpredictable </li>
9-
<li> publishable (IVs are frequently published) </li>
10-
<li> authenticated, along with the ciphertext, with a Message Authentication Code (MAC) </li>
11-
</ul>
12-
<p>This rule raises an issue when the IV is hard-coded.</p>
1+
<p>When encrypting data with the Cipher Block Chaining (CBC) mode an Initialization Vector (IV) is used to randomize the encryption, ie under a given
2+
key the same plaintext doesn't always produce the same ciphertext. The IV doesn't need to be secret but should be unpredictable to avoid
3+
"Chosen-Plaintext Attack".</p>
4+
<p>To generate Initialization Vectors, NIST recommends to use a secure random number generator.</p>
135
<h2>Noncompliant Code Example</h2>
146
<p>For <a href="https://github.com/Legrandin/pycryptodome">PyCryptodome</a> module:</p>
157
<pre>
@@ -54,6 +46,9 @@ <h2>See</h2>
5446
<ul>
5547
<li> <a href="https://www.owasp.org/index.php/Top_10-2017_A6-Security_Misconfiguration">OWASP Top 10 2017 Category A6</a> - Security
5648
Misconfiguration </li>
49+
<li> <a href="http://cwe.mitre.org/data/definitions/329">MITRE, CWE-329</a> - CWE-329: Not Using an Unpredictable IV with CBC Mode </li>
5750
<li> <a href="http://cwe.mitre.org/data/definitions/330">MITRE, CWE-330</a> - Use of Insufficiently Random Values </li>
51+
<li> <a href="https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf">NIST, SP-800-38A</a> - Recommendation for Block Cipher
52+
Modes of Operation </li>
5853
</ul>
5954

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S3329.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"title": "Cipher Block Chaining IV's should be random and unique",
2+
"title": "Cipher Block Chaining IV's should be unpredictable",
33
"type": "VULNERABILITY",
44
"status": "ready",
55
"remediation": {
@@ -16,7 +16,8 @@
1616
"scope": "Main",
1717
"securityStandards": {
1818
"CWE": [
19-
330
19+
330,
20+
329
2021
],
2122
"OWASP": [
2223
"A6"

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S3752.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h2>See</h2>
6969
<li> <a href="https://owasp.org/www-project-top-ten/OWASP_Top_Ten_2017/Top_10-2017_A5-Broken_Access_Control">OWASP Top 10 2017 Category A5</a> -
7070
Broken Access Control </li>
7171
<li> <a href="https://cwe.mitre.org/data/definitions/352.html">MITRE, CWE-352</a> - Cross-Site Request Forgery (CSRF) </li>
72-
<li> <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29">OWASP: Cross-Site Request Forgery</a> </li>
72+
<li> <a href="https://owasp.org/www-community/attacks/csrf">OWASP: Cross-Site Request Forgery</a> </li>
7373
<li> <a href="https://www.sans.org/top25-software-errors/#cat1">SANS Top 25</a> - Insecure Interaction Between Components </li>
7474
<li> <a href="https://docs.djangoproject.com/en/3.1/topics/http/decorators/#allowed-http-methods">Django</a> - Allowed HTTP Methods </li>
7575
<li> <a href="https://flask.palletsprojects.com/en/1.1.x/quickstart/#http-methods">Flask</a> - HTTP Methods </li>

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S4423.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"sans-top25-porous",
1414
"owasp-a3"
1515
],
16-
"defaultSeverity": "Major",
16+
"defaultSeverity": "Critical",
1717
"ruleSpecification": "RSPEC-4423",
1818
"sqKey": "S4423",
1919
"scope": "Main",

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S4426.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"owasp-a6",
1313
"owasp-a3"
1414
],
15-
"defaultSeverity": "Blocker",
15+
"defaultSeverity": "Critical",
1616
"ruleSpecification": "RSPEC-4426",
1717
"sqKey": "S4426",
1818
"scope": "Main",

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S4502.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ <h2>See</h2>
141141
<li> <a href="https://cwe.mitre.org/data/definitions/352.html">MITRE, CWE-352</a> - Cross-Site Request Forgery (CSRF) </li>
142142
<li> <a href="https://www.owasp.org/index.php/Top_10-2017_A6-Security_Misconfiguration">OWASP Top 10 2017 Category A6</a> - Security
143143
Misconfiguration </li>
144-
<li> <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29">OWASP: Cross-Site Request Forgery</a> </li>
144+
<li> <a href="https://owasp.org/www-community/attacks/csrf">OWASP: Cross-Site Request Forgery</a> </li>
145145
<li> <a href="https://www.sans.org/top25-software-errors/#cat1">SANS Top 25</a> - Insecure Interaction Between Components </li>
146146
</ul>
147147

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S5542.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
<p>To perform secure cryptography, operation modes and padding scheme are essentials and should be used correctly according to the encryption
2-
algorithm:</p>
1+
<p>Encryption operation mode and the padding scheme should be chosen appropriately to guarantee data confidentiality, integrity and authenticity:</p>
32
<ul>
4-
<li> For block cipher encryption algorithms (like AES), the GCM (Galois Counter Mode) mode that <a
5-
href="https://en.wikipedia.org/wiki/Galois/Counter_Mode#Mathematical_basis">works internally</a> with zero/no padding scheme, is recommended. At the
6-
opposite, these modes and/or schemes are highly discouraged:
3+
<li> For block cipher encryption algorithms (like AES):
74
<ul>
8-
<li> Electronic Codebook (ECB) mode is vulnerable because it doesn't provide serious message confidentiality: under a given key any given
9-
plaintext block always gets encrypted to the same ciphertext block. </li>
10-
<li> Cipher Block Chaining (CBC) with PKCS#5 padding (or PKCS#7) is vulnerable to padding oracle attacks. </li>
5+
<li> The GCM (Galois Counter Mode) mode which <a href="https://en.wikipedia.org/wiki/Galois/Counter_Mode#Mathematical_basis">works
6+
internally</a> with zero/no padding scheme, is recommended, as it is designed to provide both data authenticity (integrity) and confidentiality.
7+
Other similar modes are CCM, CWC, EAX, IAPM and OCB. </li>
8+
<li> The CBC (Cipher Block Chaining) mode by itself provides only data confidentiality, it's recommended to use it along with Message
9+
Authentication Code or similar to achieve data authenticity (integrity) too and thus to <a
10+
href="https://en.wikipedia.org/wiki/Padding_oracle_attack">prevent padding oracle attacks</a>. </li>
11+
<li> The ECB (Electronic Codebook) mode doesn't provide serious message confidentiality: under a given key any given plaintext block always gets
12+
encrypted to the same ciphertext block. This mode should not be used. </li>
1113
</ul> </li>
12-
<li> RSA encryption algorithm should be used with the recommended padding scheme (OAEP) </li>
14+
<li> For RSA encryption algorithm, the recommended padding scheme is OAEP. </li>
1315
</ul>
1416
<h2>Noncompliant Code Examples</h2>
1517
<p><a href="https://pycryptodome.readthedocs.io">pycryptodomex</a> library:</p>
@@ -48,7 +50,7 @@ <h2>Noncompliant Code Examples</h2>
4850
padding.PKCS1v15() # Noncompliant
4951
)
5052
</pre>
51-
<p><a href="http://whitemans.ca/des.html">pydes</a> library:</p>
53+
<p><a href="https://pypi.org/project/pyDes/">pydes</a> library:</p>
5254
<pre>
5355
# For DES cipher
5456
des = pyDes.des('ChangeIt') # Noncompliant

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S5542.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"sans-top25-porous",
1010
"owasp-a3"
1111
],
12-
"defaultSeverity": "Blocker",
12+
"defaultSeverity": "Critical",
1313
"ruleSpecification": "RSPEC-5542",
1414
"sqKey": "S5542",
1515
"scope": "Main",

0 commit comments

Comments
 (0)