Skip to content

Update security rules: add OWASP Mobile Top 10 2024 security standard (APPSEC-2383) #4660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
826a8e7
Add OWASP Mobile Top 10 2024 to JSON schema
pierre-loup-tristant-sonarsource Feb 12, 2025
0b7ded0
Update security standards for S2245
pierre-loup-tristant-sonarsource Feb 14, 2025
8259e8e
Update security standards for S2053
pierre-loup-tristant-sonarsource Feb 14, 2025
ddd8d3b
Update security standards for S2076
pierre-loup-tristant-sonarsource Feb 14, 2025
9ea2d85
Update security standards for S2083
pierre-loup-tristant-sonarsource Feb 14, 2025
1411f0c
Update security standards for S2755
pierre-loup-tristant-sonarsource Feb 14, 2025
2220fa7
Update security standards for S3329
pierre-loup-tristant-sonarsource Feb 14, 2025
cfa3bc7
Update security standards for S3649
pierre-loup-tristant-sonarsource Feb 14, 2025
bfe0148
Update security standards for S4347
pierre-loup-tristant-sonarsource Feb 14, 2025
c50d1f9
Update security standards for S4423
pierre-loup-tristant-sonarsource Feb 14, 2025
4ee64fc
Update security standards for S4426
pierre-loup-tristant-sonarsource Feb 14, 2025
eb60698
Update security standards for S4790
pierre-loup-tristant-sonarsource Feb 17, 2025
2e0d340
Update security standards for S4830
pierre-loup-tristant-sonarsource Feb 17, 2025
627e01c
Update security standards for S5320
pierre-loup-tristant-sonarsource Feb 17, 2025
44d4b1f
Update security standards for S5322
pierre-loup-tristant-sonarsource Feb 17, 2025
5b7844c
Update security standards for S5324
pierre-loup-tristant-sonarsource Feb 17, 2025
dfdbcb3
Update security standards for S5332
pierre-loup-tristant-sonarsource Feb 17, 2025
d0caf0a
Update security standards for S5344
pierre-loup-tristant-sonarsource Feb 17, 2025
3711b23
Update security standards for S5527
pierre-loup-tristant-sonarsource Feb 17, 2025
7e46c44
Update security standards for S5542
pierre-loup-tristant-sonarsource Feb 17, 2025
378ef12
Update security standards for S5547
pierre-loup-tristant-sonarsource Feb 17, 2025
bb66574
Update security standards for S5594
pierre-loup-tristant-sonarsource Feb 17, 2025
b5f0621
Update security standards for S5604
pierre-loup-tristant-sonarsource Feb 17, 2025
1b1952f
Update security standards for S5883
pierre-loup-tristant-sonarsource Feb 17, 2025
7436ec4
Update security standards for S6096
pierre-loup-tristant-sonarsource Feb 17, 2025
8028bad
Update security standards for S6288
pierre-loup-tristant-sonarsource Feb 17, 2025
02baaff
Update security standards for S6291
pierre-loup-tristant-sonarsource Feb 17, 2025
e01c0a2
Update security standards for S6293
pierre-loup-tristant-sonarsource Feb 17, 2025
1f7110e
Update security standards for S6300
pierre-loup-tristant-sonarsource Feb 17, 2025
cd053c5
Update security standards for S6301
pierre-loup-tristant-sonarsource Feb 17, 2025
bd80622
Update security standards for S6385
pierre-loup-tristant-sonarsource Feb 17, 2025
f91511c
Update security standards for S6359
pierre-loup-tristant-sonarsource Feb 17, 2025
aefbb9e
Update security standards for S6361
pierre-loup-tristant-sonarsource Feb 17, 2025
18270d2
Update security standards for S6362
pierre-loup-tristant-sonarsource Feb 17, 2025
4025c79
Update security standards for S6363
pierre-loup-tristant-sonarsource Feb 17, 2025
c4dac07
Update security standards for S6373
pierre-loup-tristant-sonarsource Feb 17, 2025
2a3c480
Update security standards for S6376
pierre-loup-tristant-sonarsource Feb 17, 2025
bb59071
Update security standards for S6384
pierre-loup-tristant-sonarsource Feb 17, 2025
54c5163
Update security standards for S6432
pierre-loup-tristant-sonarsource Feb 17, 2025
8dcda03
Update security standards for S6549
pierre-loup-tristant-sonarsource Feb 17, 2025
71e1307
Update security standards for S6706
pierre-loup-tristant-sonarsource Feb 17, 2025
a9fc1d1
Fix empty security standards for IaC rules S4423 and S5332
pierre-loup-tristant-sonarsource Feb 19, 2025
6256263
Fix asciidoc imports for S2245
pierre-loup-tristant-sonarsource Feb 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions rspec-tools/rspec_tools/validation/rule-metadata-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@
},
"uniqueItems": true
},
"OWASP Mobile Top 10 2024": {
"type": "array",
"minItems": 0,
"items": {
"type": "string",
"pattern": "^M([1-9]|10)$"
},
"uniqueItems": true
},
"PCI DSS 3.2": {
"type": "array",
"minItems": 0,
Expand Down
9 changes: 9 additions & 0 deletions rules/S2053/common/resources/standards-mobile.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=== Standards

* OWASP - https://owasp.org/Top10/A02_2021-Cryptographic_Failures/[Top 10 2021 Category A2 - Cryptographic Failures]
* OWASP - https://www.owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure[Top 10 2017 Category A3 - Sensitive Data Exposure]
* OWASP - https://owasp.org/www-project-mobile-top-10/2023-risks/m10-insufficient-cryptography[Mobile Top 10 2024 Category M10 - Insufficient Cryptography]
* CWE - https://cwe.mitre.org/data/definitions/759[CWE-759 - Use of a One-Way Hash without a Salt]
* CWE - https://cwe.mitre.org/data/definitions/760[CWE-760 - Use of a One-Way Hash with a Predictable Salt]
* STIG Viewer - https://stigviewer.com/stig/application_security_and_development/2023-06-08/finding/V-222542[Application Security and Development: V-222542] - The application must only store cryptographic representations of passwords.

25 changes: 24 additions & 1 deletion rules/S2053/java/metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
{

"securityStandards": {
"CWE": [
759,
760
],
"OWASP": [
"A3"
],
"OWASP Top 10 2021": [
"A2"
],
"OWASP Mobile Top 10 2024": [
"M10"
],
"PCI DSS 3.2": [
"6.5.10"
],
"PCI DSS 4.0": [
"6.2.4"
],
"STIG ASD_V5R3": [
"V-222542"
]
}
}
2 changes: 1 addition & 1 deletion rules/S2053/java/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include::how-to-fix-it/java-se.adoc[]

== Resources

include::../common/resources/standards.adoc[]
include::../common/resources/standards-mobile.adoc[]

ifdef::env-github,rspecator-view[]

Expand Down
25 changes: 24 additions & 1 deletion rules/S2053/kotlin/metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
{

"securityStandards": {
"CWE": [
759,
760
],
"OWASP": [
"A3"
],
"OWASP Top 10 2021": [
"A2"
],
"OWASP Mobile Top 10 2024": [
"M10"
],
"PCI DSS 3.2": [
"6.5.10"
],
"PCI DSS 4.0": [
"6.2.4"
],
"STIG ASD_V5R3": [
"V-222542"
]
}
}
2 changes: 1 addition & 1 deletion rules/S2053/kotlin/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include::how-to-fix-it/java-se.adoc[]

== Resources

include::../common/resources/standards.adoc[]
include::../common/resources/standards-mobile.adoc[]

ifdef::env-github,rspecator-view[]

Expand Down
10 changes: 10 additions & 0 deletions rules/S2076/common/resources/standards-mobile.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
=== Standards

* OWASP - https://owasp.org/Top10/A03_2021-Injection/[Top 10 2021 Category A3 - Injection]
* OWASP - https://owasp.org/www-project-top-ten/2017/A1_2017-Injection[Top 10 2017 Category A1 - Injection]
* OWASP - https://owasp.org/www-project-mobile-top-10/2023-risks/m4-insufficient-input-output-validation[Mobile Top 10 2024 Category M4 - Insufficient Input/Output Validation]
* CWE - https://cwe.mitre.org/data/definitions/20[CWE-20 - Improper Input Validation]
* CWE - https://cwe.mitre.org/data/definitions/78[CWE-78 - Improper Neutralization of Special Elements used in an OS Command]
* STIG Viewer - https://stigviewer.com/stig/application_security_and_development/2023-06-08/finding/V-222604[Application Security and Development: V-222604] - The application must protect from command injection.
* STIG Viewer - https://stigviewer.com/stig/application_security_and_development/2023-06-08/finding/V-222609[Application Security and Development: V-222609] - The application must not be subject to input handling vulnerabilities.

32 changes: 31 additions & 1 deletion rules/S2076/java/metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
{

"securityStandards": {
"CWE": [
20,
78
],
"OWASP": [
"A1"
],
"OWASP Top 10 2021": [
"A3"
],
"OWASP Mobile Top 10 2024": [
"M4"
],
"PCI DSS 3.2": [
"6.5.1"
],
"PCI DSS 4.0": [
"6.2.4"
],
"ASVS 4.0": [
"12.3.5",
"5.1.3",
"5.1.4",
"5.3.8"
],
"STIG ASD_V5R3": [
"V-222604",
"V-222609"
]
}
}
2 changes: 1 addition & 1 deletion rules/S2076/java/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include::how-to-fix-it/java-se.adoc[]

include::../common/resources/docs.adoc[]

include::../common/resources/standards.adoc[]
include::../common/resources/standards-mobile.adoc[]

ifdef::env-github,rspecator-view[]

Expand Down
11 changes: 11 additions & 0 deletions rules/S2083/common/resources/standards-mobile.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
=== Standards

* OWASP - https://owasp.org/Top10/A01_2021-Broken_Access_Control/[Top 10 2021 Category A1 - Broken Access Control]
* OWASP - https://owasp.org/Top10/A03_2021-Injection/[Top 10 2021 Category A3 - Injection]
* OWASP - https://owasp.org/www-project-top-ten/2017/A1_2017-Injection[Top 10 2017 Category A1 - Injection]
* OWASP - https://owasp.org/www-project-top-ten/2017/A5_2017-Broken_Access_Control[Top 10 2017 Category A5 - Broken Access Control]
* OWASP - https://owasp.org/www-project-mobile-top-10/2023-risks/m4-insufficient-input-output-validation[Mobile Top 10 2024 Category M4 - Insufficient Input/Output Validation]
* CWE - https://cwe.mitre.org/data/definitions/20[CWE-20 - Improper Input Validation]
* CWE - https://cwe.mitre.org/data/definitions/22[CWE-22 - Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')]
* STIG Viewer - https://stigviewer.com/stig/application_security_and_development/2023-06-08/finding/V-222609[Application Security and Development: V-222609] - The application must not be subject to input handling vulnerabilities.

32 changes: 31 additions & 1 deletion rules/S2083/java/metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
{

"securityStandards": {
"CWE": [
20,
22
],
"OWASP": [
"A5",
"A1"
],
"OWASP Top 10 2021": [
"A1",
"A3"
],
"OWASP Mobile Top 10 2024": [
"M4"
],
"PCI DSS 3.2": [
"6.5.8"
],
"PCI DSS 4.0": [
"6.2.4"
],
"ASVS 4.0": [
"12.3.1",
"5.1.3",
"5.1.4"
],
"STIG ASD_V5R3": [
"V-222609"
]
}
}
2 changes: 1 addition & 1 deletion rules/S2083/java/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include::how-to-fix-it/java-se.adoc[]

== Resources

include::../common/resources/standards.adoc[]
include::../common/resources/standards-mobile.adoc[]

ifdef::env-github,rspecator-view[]

Expand Down
6 changes: 0 additions & 6 deletions rules/S2245/cfamily/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
"OWASP": [
"A3"
],
"OWASP Mobile": [
"M5"
],
"MASVS": [
"MSTG-CRYPTO-6"
],
"OWASP Top 10 2021": [
"A2"
],
Expand Down
13 changes: 2 additions & 11 deletions rules/S2245/cfamily/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,8 @@ void f() {
}
----

== See

* OWASP - https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#secure-random-number-generation[Secure Random Number Generation Cheat Sheet]
* OWASP - https://owasp.org/Top10/A02_2021-Cryptographic_Failures/[Top 10 2021 Category A2 - Cryptographic Failures]
* OWASP - https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure[Top 10 2017 Category A3 - Sensitive Data Exposure]
* OWASP - https://mas.owasp.org/checklists/MASVS-CRYPTO/[Mobile AppSec Verification Standard - Cryptography Requirements]
* OWASP - https://owasp.org/www-project-mobile-top-10/2016-risks/m5-insufficient-cryptography[Mobile Top 10 2016 Category M5 - Insufficient Cryptography]
* CWE - https://cwe.mitre.org/data/definitions/338[CWE-338 - Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)]
* CWE - https://cwe.mitre.org/data/definitions/330[CWE-330 - Use of Insufficiently Random Values]
* CWE - https://cwe.mitre.org/data/definitions/326[CWE-326 - Inadequate Encryption Strength]
* CWE - https://cwe.mitre.org/data/definitions/1241[CWE-1241 - Use of Predictable Algorithm in Random Number Generator]
include::../see.adoc[]

* https://wiki.sei.cmu.edu/confluence/x/UNcxBQ[CERT, MSC30-C.] - Do not use the rand() function for generating pseudorandom numbers
* https://wiki.sei.cmu.edu/confluence/x/2ns-BQ[CERT, MSC50-CPP.] - Do not use std::rand() for generating pseudorandom numbers
* Derived from FindSecBugs rule https://h3xstream.github.io/find-sec-bugs/bugs.htm#PREDICTABLE_RANDOM[Predictable Pseudo Random Number Generator]
Expand Down
3 changes: 3 additions & 0 deletions rules/S2245/java/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"OWASP Mobile": [
"M5"
],
"OWASP Mobile Top 10 2024": [
"M10"
],
"MASVS": [
"MSTG-CRYPTO-6"
],
Expand Down
11 changes: 2 additions & 9 deletions rules/S2245/java/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,12 @@ byte bytes[] = new byte[20];
random.nextBytes(bytes);
----

== See
include::../see.adoc[]

* OWASP - https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#secure-random-number-generation[Secure Random Number Generation Cheat Sheet]
* OWASP - https://owasp.org/Top10/A02_2021-Cryptographic_Failures/[Top 10 2021 Category A2 - Cryptographic Failures]
* OWASP - https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure[Top 10 2017 Category A3 - Sensitive Data Exposure]
* OWASP - https://mas.owasp.org/checklists/MASVS-CRYPTO/[Mobile AppSec Verification Standard - Cryptography Requirements]
* OWASP - https://owasp.org/www-project-mobile-top-10/2016-risks/m5-insufficient-cryptography[Mobile Top 10 2016 Category M5 - Insufficient Cryptography]
* CWE - https://cwe.mitre.org/data/definitions/338[CWE-338 - Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)]
* CWE - https://cwe.mitre.org/data/definitions/330[CWE-330 - Use of Insufficiently Random Values]
* CWE - https://cwe.mitre.org/data/definitions/326[CWE-326 - Inadequate Encryption Strength]
* CWE - https://cwe.mitre.org/data/definitions/1241[CWE-1241 - Use of Predictable Algorithm in Random Number Generator]
* OWASP - https://owasp.org/www-project-mobile-top-10/2023-risks/m10-insufficient-cryptography[Mobile Top 10 2024 Category M10 - Insufficient Cryptography]
* https://wiki.sei.cmu.edu/confluence/x/oTdGBQ[CERT, MSC02-J.] - Generate strong random numbers
* Derived from FindSecBugs rule https://h3xstream.github.io/find-sec-bugs/bugs.htm#PREDICTABLE_RANDOM[Predictable Pseudo Random Number Generator]

ifdef::env-github,rspecator-view[]

Expand Down
26 changes: 26 additions & 0 deletions rules/S2245/kotlin/metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
{
"securityStandards": {
"CWE": [
326,
330,
338,
1241
],
"OWASP": [
"A3"
],
"OWASP Mobile": [
"M5"
],
"OWASP Mobile Top 10 2024": [
"M10"
],
"MASVS": [
"MSTG-CRYPTO-6"
],
"OWASP Top 10 2021": [
"A2"
],
"ASVS 4.0": [
"6.2.4"
]
},
"quickfix": "unknown"
}
4 changes: 4 additions & 0 deletions rules/S2245/kotlin/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ random.nextBytes(bytes)

include::../see.adoc[]

* OWASP - https://mas.owasp.org/checklists/MASVS-CRYPTO/[Mobile AppSec Verification Standard - Cryptography Requirements]
* OWASP - https://owasp.org/www-project-mobile-top-10/2016-risks/m5-insufficient-cryptography[Mobile Top 10 2016 Category M5 - Insufficient Cryptography]
* OWASP - https://owasp.org/www-project-mobile-top-10/2023-risks/m10-insufficient-cryptography[Mobile Top 10 2024 Category M10 - Insufficient Cryptography]

ifdef::env-github,rspecator-view[]

'''
Expand Down
6 changes: 0 additions & 6 deletions rules/S2245/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@
"OWASP": [
"A3"
],
"OWASP Mobile": [
"M5"
],
"MASVS": [
"MSTG-CRYPTO-6"
],
"OWASP Top 10 2021": [
"A2"
],
Expand Down
5 changes: 1 addition & 4 deletions rules/S2245/see.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
* OWASP - https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#secure-random-number-generation[Secure Random Number Generation Cheat Sheet]
* OWASP - https://owasp.org/Top10/A02_2021-Cryptographic_Failures/[Top 10 2021 Category A2 - Cryptographic Failures]
* OWASP - https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure[Top 10 2017 Category A3 - Sensitive Data Exposure]
* OWASP - https://mas.owasp.org/checklists/MASVS-CRYPTO/[Mobile AppSec Verification Standard - Cryptography Requirements]
* OWASP - https://owasp.org/www-project-mobile-top-10/2016-risks/m5-insufficient-cryptography[Mobile Top 10 2016 Category M5 - Insufficient Cryptography]
* CWE - https://cwe.mitre.org/data/definitions/338[CWE-338 - Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)]
* CWE - https://cwe.mitre.org/data/definitions/330[CWE-330 - Use of Insufficiently Random Values]
* CWE - https://cwe.mitre.org/data/definitions/326[CWE-326 - Inadequate Encryption Strength]
* CWE - https://cwe.mitre.org/data/definitions/1241[CWE-1241 - Use of Predictable Algorithm in Random Number Generator]
* Derived from FindSecBugs rule https://h3xstream.github.io/find-sec-bugs/bugs.htm#PREDICTABLE_RANDOM[Predictable Pseudo Random Number Generator]
* CWE - https://cwe.mitre.org/data/definitions/1241[CWE-1241 - Use of Predictable Algorithm in Random Number Generator]
10 changes: 10 additions & 0 deletions rules/S2755/common/resources/standards-mobile.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
=== Standards

* OWASP - https://owasp.org/Top10/A05_2021-Security_Misconfiguration/[Top 10 2021 Category A5 - Security Misconfiguration]
* OWASP - https://owasp.org/www-project-top-ten/2017/A4_2017-XML_External_Entities_(XXE)[Top 10 2017 Category A4 - XML External Entities (XXE)]
* OWASP - https://owasp.org/www-project-mobile-top-10/2023-risks/m4-insufficient-input-output-validation[Mobile Top 10 2024 Category M4 - Insufficient Input/Output Validation]
* OWASP - https://owasp.org/www-project-mobile-top-10/2023-risks/m8-security-misconfiguration[Mobile Top 10 2024 Category M8 - Security Misconfiguration]
* CWE - https://cwe.mitre.org/data/definitions/611[CWE-611 - Information Exposure Through XML External Entity Reference]
* CWE - https://cwe.mitre.org/data/definitions/827[CWE-827 - Improper Control of Document Type Definition]
* STIG Viewer - https://stigviewer.com/stig/application_security_and_development/2023-06-08/finding/V-222608[Application Security and Development: V-222608] - The application must not be vulnerable to XML-oriented attacks.

28 changes: 28 additions & 0 deletions rules/S2755/java/metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
{
"securityStandards": {
"CWE": [
611,
827
],
"OWASP": [
"A4"
],
"OWASP Top 10 2021": [
"A5"
],
"OWASP Mobile Top 10 2024": [
"M4",
"M8"
],
"PCI DSS 3.2": [
"6.5.1"
],
"PCI DSS 4.0": [
"6.2.4"
],
"ASVS 4.0": [
"5.5.2"
],
"STIG ASD_V5R3": [
"V-222608"
]
},
"quickfix": "infeasible",
"tags": [
"cwe",
Expand Down
2 changes: 1 addition & 1 deletion rules/S2755/java/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include::how-to-fix-it/sax.adoc[]

== Resources

include::../common/resources/standards.adoc[]
include::../common/resources/standards-mobile.adoc[]

ifdef::env-github,rspecator-view[]

Expand Down
Loading