Skip to content

Commit

Permalink
Merge pull request #1076 from AdaCore/add_cwe_to_coding_standards
Browse files Browse the repository at this point in the history
Add CWE to each standard
  • Loading branch information
gusthoff authored Jul 20, 2024
2 parents b04eaca + 8ffabaa commit 512a859
Show file tree
Hide file tree
Showing 44 changed files with 290 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ Applicable Vulnerability within ISO TR 24772-2
* 6.62 Concurrency - Premature termination [CGS]
* 6.63 Lock protocol errors [CGM]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-362 - Concurrent Execution using Shared Resource with Improper Synchronization <362>`
* :cwe:`CWE-367 - Time-of-check Time-of-use (TOCTOU) Race Condition <367>`
* :cwe:`CWE-366 - Race Condition within a Thread <366>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ Applicable Vulnerability within ISO TR 24772-2
* 6.62 Concurrency - Premature termination [CGS]
* 6.63 Lock protocol errors [CGM]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-362 - Concurrent Execution using Shared Resource with Improper Synchronization <362>`
* :cwe:`CWE-367 - Time-of-check Time-of-use (TOCTOU) Race Condition <367>`
* :cwe:`CWE-366 - Race Condition within a Thread <366>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.56 Undefined behaviour [EWF]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-567 - Unsynchronized Access to Shared Data in a Multithreaded Context <567>`
* :cwe:`CWE-667 - Improper Locking <667>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ Applicable Vulnerability within ISO TR 24772-2

* 4.10 Storage Pool

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-401 - Missing Release of Memory after Effective Lifetime <401>`
* :cwe:`CWE-415 - Double Free <415>`
* :cwe:`CWE-416 - Use After Free <416>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ Applicable Vulnerability within ISO TR 24772-2

* 4.10 Storage Pool

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-401 - Missing Release of Memory after Effective Lifetime <401>`
* :cwe:`CWE-758 - Reliance on Undefined, Unspecified, or Implementation-Defined Behavior <758>`
* :cwe:`CWE-771 - Missing Reference to Active Allocated Resource <771>`
* :cwe:`CWE-1325 - Improperly Controlled Sequential Memory Allocation <1325>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.14 Dangling reference to heap [XYK]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-401 - Missing Release of Memory after Effective Lifetime <401>`
* :cwe:`CWE-415 - Double Free <415>`
* :cwe:`CWE-416 - Use After Free <416>`
* :cwe:`CWE-771 - Missing Reference to Active Allocated Resource <771>`
* :cwe:`CWE-1325 - Improperly Controlled Sequential Memory Allocation <1325>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ Applicable Vulnerability within ISO TR 24772-2

* 4.10 Storage Pool

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-401 - Missing Release of Memory after Effective Lifetime <401>`
* :cwe:`CWE-415 - Double Free <415>`
* :cwe:`CWE-416 - Use After Free <416>`
* :cwe:`CWE-771 - Missing Reference to Active Allocated Resource <771>`
* :cwe:`CWE-1325 - Improperly Controlled Sequential Memory Allocation <1325>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Applicable Vulnerability within ISO TR 24772-2

* 4.10 Storage Pool

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-401 - Missing Release of Memory after Effective Lifetime <401>`
* :cwe:`CWE-415 - Double Free <415>`
* :cwe:`CWE-416 - Use After Free <416>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ Applicable Vulnerability within ISO TR 24772-2

* 4.10 Storage Pool

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-770 - Allocation of Resources Without Limits or Throttling <770>`
* :cwe:`CWE-789 - Uncontrolled Memory Allocation <789>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ Applicable Vulnerability within ISO TR 24772-2

N/A

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-397 - Declaration of Throws for Generic Exception <397>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.36 Ignored error status and unhandled exceptions [OYB]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-248 - Uncaught Exception <248>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Applicable Vulnerability within ISO TR 24772-2

N/A

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-248 - Uncaught Exception <248>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ Applicable Vulnerability within ISO TR 24772-2

N/A

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-248 - Uncaught Exception <248>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.43 Redispatching [PPH]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

N/A

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.43 Redispatching [PPH]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

N/A

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.41 Inheritance [RIP]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-1074 - Class with Excessively Deep Inheritance <1074>`
* :cwe:`CWE-1086 - Class with Excessive Number of Child Classes <1086>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ Applicable Vulnerability within ISO TR 24772-2
* 6.43 Redispatching [PPH]
* 6.44 Polymorphic variables [BKK]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

N/A

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ Applicable Vulnerability within ISO TR 24772-2
* 6.34 Subprogram signature mismatch [OTR]
* 6.41 Inheritance [RIP]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-685 - Function Call With Incorrect Number of Arguments <685>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ Applicable Vulnerability within ISO TR 24772-2
* 6.42 Violations of the Liskov substitution principle or the contract model
[BLP]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

N/A

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ Applicable Vulnerability within ISO TR 24772-2
* 6.43 Redispatching [PPH]
* 6.44 Polymorphic variables [BKK]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

N/A

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.27 Switch statements and static analysis [CLL]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-478 - Missing Default Case in Multiple Condition Expression <478>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.5 Enumerator issues [CCB]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

N/A

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ Applicable Vulnerability within ISO TR 24772-2
* 6.5 Enumerator issues [CCB]
* 6.27 Switch statements and static analysis [CLL]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-478 - Missing Default Case in Multiple Condition Expression <478>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.32 Passing parameters and return values [CSJ]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-457 - Use of Uninitialized Variable <457>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ Applicable Vulnerability within ISO TR 24772-2

N/A

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-396 - Declaration of Catch for Generic Exception <396>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.24 Side-effects and order of evaluation [SAM]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

N/A

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.24 Side-effects and order of evaluation [SAM]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

N/A

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ Applicable Vulnerability within ISO TR 24772-2

* 6.32 Passing parameters and return values [CSJ]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

N/A

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ Applicable Vulnerability within ISO TR 24772-2
* 6.42 Violations of the Liskov substitution principle or the contract model
[BLP]

++++++++++++++++++++++++++++++++++++++++
Applicable Common Weakness Enumeration
++++++++++++++++++++++++++++++++++++++++

* :cwe:`CWE-754 - Improper Check for Unusual or Exceptional Conditions <754>`

+++++++++++++++++++++++++++
Noncompliant Code Example
+++++++++++++++++++++++++++
Expand Down
Loading

0 comments on commit 512a859

Please sign in to comment.