Seagate / openSeaChest

Cross platform utilities useful for performing various operations on SATA, SAS, NVMe, and USB storage devices.
Other
436 stars 60 forks source link

Code Security Report: 6 high severity findings, 16 total findings #140

Open mend-for-github-com[bot] opened 3 months ago

mend-for-github-com[bot] commented 3 months ago

Code Security Report

Scan Metadata

Latest Scan: 2024-05-31 07:55pm Total Findings: 16 | New Findings: 3 | Resolved Findings: 1 Tested Project Files: 22 Detected Programming Languages: 1 (C/C++ (Beta))

Most Relevant Findings

The list below presents the 10 most relevant findings that need your attention. To view information on the remaining findings, navigate to the Mend Application.

SeverityVulnerability TypeCWEFileData FlowsDate
HighOut of Buffer Bounds Write [CWE-787](https://cwe.mitre.org/data/definitions/787.html) [openseachest_util_options.c:3323](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3323) 322024-05-31 07:57pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3318-L3323
32 Data Flow/s detected
View Data Flow 1 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3323
View Data Flow 2 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3323
View Data Flow 3 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3323
[View more Data Flows](https://saas.whitesourcesoftware.com/app/orgs/STX-PUBLIC/scans/fa46e8f6-e74d-49c6-b899-8651a4eec248/sast?project=7085bcf0-2ab3-4e8b-9a2e-7932a9dc9707&findingSnapshotId=1f88519f-84a9-433b-8622-addb779cd13c&filtered=yes)
Secure Code Warrior Training Material ● Training    ▪ [Secure Code Warrior Out of Buffer Bounds Write Training](https://portal.securecodewarrior.com/?utm_source=partner-integration:mend&partner_id=mend#/contextual-microlearning/web/memory/buffer/cpp/vanilla) ● Videos    ▪ [Secure Code Warrior Out of Buffer Bounds Write Video](https://media.securecodewarrior.com/v2/Module_56_Buffer_Overflow_v2.mp4)
 
HighBuffer Overflow [CWE-121](https://cwe.mitre.org/data/definitions/121.html) [openseachest_util_options.c:3323](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3323) 322024-05-31 07:57pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3318-L3323
32 Data Flow/s detected
View Data Flow 1 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3287 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3315 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3323
View Data Flow 2 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3287 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3315 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3323
View Data Flow 3 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3287 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3315 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3323
[View more Data Flows](https://saas.whitesourcesoftware.com/app/orgs/STX-PUBLIC/scans/fa46e8f6-e74d-49c6-b899-8651a4eec248/sast?project=7085bcf0-2ab3-4e8b-9a2e-7932a9dc9707&findingSnapshotId=4e0268c0-d59a-4094-ad90-ba5fa44b602e&filtered=yes)
Secure Code Warrior Training Material ● Training    ▪ [Secure Code Warrior Buffer Overflow Training](https://portal.securecodewarrior.com/?utm_source=partner-integration:mend&partner_id=mend#/contextual-microlearning/web/memory/stack/cpp/vanilla) ● Videos    ▪ [Secure Code Warrior Buffer Overflow Video](https://media.securecodewarrior.com/v2/Module_53_Stack_Overflow_v2.mp4)
 
HighPath/Directory Traversal [CWE-22](https://cwe.mitre.org/data/definitions/22.html) [openSeaChest_Format.c:461](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Format.c#L461) 12024-04-02 07:30pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Format.c#L456-L461
1 Data Flow/s detected
https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Format.c#L446 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Format.c#L460 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Format.c#L461
Secure Code Warrior Training Material ● Training    ▪ [Secure Code Warrior Path/Directory Traversal Training](https://portal.securecodewarrior.com/?utm_source=partner-integration:mend&partner_id=mend#/contextual-microlearning/web/injection/pathtraversal/cpp/vanilla) ● Videos    ▪ [Secure Code Warrior Path/Directory Traversal Video](https://media.securecodewarrior.com/v2/module_196_path_traversal.mp4) ● Further Reading    ▪ [OWASP Path Traversal](https://owasp.org/www-community/attacks/Path_Traversal)    ▪ [OWASP Input Validation Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html)
 
HighPath/Directory Traversal [CWE-22](https://cwe.mitre.org/data/definitions/22.html) [openSeaChest_Format.c:460](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Format.c#L460) 12024-04-02 07:30pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Format.c#L455-L460
1 Data Flow/s detected
https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Format.c#L446 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Format.c#L460
Secure Code Warrior Training Material ● Training    ▪ [Secure Code Warrior Path/Directory Traversal Training](https://portal.securecodewarrior.com/?utm_source=partner-integration:mend&partner_id=mend#/contextual-microlearning/web/injection/pathtraversal/cpp/vanilla) ● Videos    ▪ [Secure Code Warrior Path/Directory Traversal Video](https://media.securecodewarrior.com/v2/module_196_path_traversal.mp4) ● Further Reading    ▪ [OWASP Path Traversal](https://owasp.org/www-community/attacks/Path_Traversal)    ▪ [OWASP Input Validation Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html)
 
HighPath/Directory Traversal [CWE-22](https://cwe.mitre.org/data/definitions/22.html) [openSeaChest_Erase.c:788](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L788) 12024-04-02 07:30pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L783-L788
1 Data Flow/s detected
https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L776 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L787 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L788
Secure Code Warrior Training Material ● Training    ▪ [Secure Code Warrior Path/Directory Traversal Training](https://portal.securecodewarrior.com/?utm_source=partner-integration:mend&partner_id=mend#/contextual-microlearning/web/injection/pathtraversal/cpp/vanilla) ● Videos    ▪ [Secure Code Warrior Path/Directory Traversal Video](https://media.securecodewarrior.com/v2/module_196_path_traversal.mp4) ● Further Reading    ▪ [OWASP Path Traversal](https://owasp.org/www-community/attacks/Path_Traversal)    ▪ [OWASP Input Validation Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html)
 
HighPath/Directory Traversal [CWE-22](https://cwe.mitre.org/data/definitions/22.html) [openSeaChest_Erase.c:787](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L787) 12024-04-02 07:30pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L782-L787
1 Data Flow/s detected
https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L776 https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L787
Secure Code Warrior Training Material ● Training    ▪ [Secure Code Warrior Path/Directory Traversal Training](https://portal.securecodewarrior.com/?utm_source=partner-integration:mend&partner_id=mend#/contextual-microlearning/web/injection/pathtraversal/cpp/vanilla) ● Videos    ▪ [Secure Code Warrior Path/Directory Traversal Video](https://media.securecodewarrior.com/v2/module_196_path_traversal.mp4) ● Further Reading    ▪ [OWASP Path Traversal](https://owasp.org/www-community/attacks/Path_Traversal)    ▪ [OWASP Input Validation Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html)
 
MediumHeap Inspection [CWE-244](https://cwe.mitre.org/data/definitions/244.html) [openseachest_util_options.c:3822](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3822) 12024-04-29 06:45pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/src/openseachest_util_options.c#L3822
Secure Code Warrior Training Material
 
MediumHeap Inspection [CWE-244](https://cwe.mitre.org/data/definitions/244.html) [openSeaChest_Erase.c:1097](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L1097) 12024-04-29 06:45pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L1097
Secure Code Warrior Training Material
 
MediumHeap Inspection [CWE-244](https://cwe.mitre.org/data/definitions/244.html) [openSeaChest_Erase.c:1089](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L1089) 12024-04-29 06:45pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L1089
Secure Code Warrior Training Material
 
MediumHeap Inspection [CWE-244](https://cwe.mitre.org/data/definitions/244.html) [openSeaChest_Erase.c:1917](https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L1917) 12024-04-29 06:45pm
Vulnerable Code https://github.com/Seagate/openSeaChest/blob/c512193ee90f96640f72d61d234c9947bb29f0ef/utils/C/openSeaChest/openSeaChest_Erase.c#L1917
Secure Code Warrior Training Material

Findings Overview

Severity Vulnerability Type CWE Language Count
High Buffer Overflow CWE-121 C/C++ (Beta) 1
High Out of Buffer Bounds Write CWE-787 C/C++ (Beta) 1
High Path/Directory Traversal CWE-22 C/C++ (Beta) 4
Medium Heap Inspection CWE-244 C/C++ (Beta) 10
vonericsen commented 1 month ago

I've been working on assessing and addressing these issues on the feature/hardening branch. Some of these issues are false-positives, some are issues that require changes to address correctly.

I'm now investigating solutions to the path/directory traversal issues listed in here and using this as a refence for how to resolve these issues: https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87151932