Skip to content
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

Code Security Report: 18 high severity findings, 26 total findings - autoclosed #177

Closed
1 task
mend-for-github-com bot opened this issue Apr 2, 2024 · 0 comments
Closed
1 task
Labels
Mend: code security findings Code security findings detected by Mend

Comments

@mend-for-github-com
Copy link
Contributor

mend-for-github-com bot commented Apr 2, 2024

Code Security Report

Scan Metadata

Latest Scan: 2025-01-10 05:40pm
Total Findings: 26 | New Findings: 0 | Resolved Findings: 0
Tested Project Files: 134
Detected Programming Languages: 2 (Go, Python)

  • Check this box to manually trigger a scan

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 FlowsDetected
HighPath/Directory Traversal

CWE-22

write.py:16

22024-09-13 04:56pm
Vulnerable Code

bytes_written = 0
data = os.urandom(blockSize)
t1 = time.time()
fd = open(os.path.join(mountpath, "application_"+size+".data"), "wb")

2 Data Flow/s detected
View Data Flow 1

size = sys.argv[2]

View Data Flow 2

mountpath = sys.argv[1]

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Path/Directory Traversal Training

● Videos

   ▪ Secure Code Warrior Path/Directory Traversal Video

● Further Reading

   ▪ OWASP Path Traversal

   ▪ OWASP Input Validation Cheat Sheet

 
HighInsecure File Permissions

CWE-732

stats_manager_linux.go:160

12024-04-02 02:23pm
Vulnerable Code

disableMonitoring()
return
}
// open transfer pipe
tf, err := os.OpenFile(common.TransferPipe, os.O_CREATE|os.O_WRONLY, 0777)

1 Data Flow/s detected

tf, err := os.OpenFile(common.TransferPipe, os.O_CREATE|os.O_WRONLY, 0777)

Secure Code Warrior Training Material
 
HighPath/Directory Traversal

CWE-22

read.py:14

22024-09-13 04:56pm
Vulnerable Code

blockSize = 8 * 1024 * 1024
fileSize = int(size) * (1024 * 1024 * 1024)
bytes_read = 0
t1 = time.time()
fd = open(os.path.join(mountpath, "application_"+size+".data"), "rb")

2 Data Flow/s detected
View Data Flow 1

size = sys.argv[2]

View Data Flow 2

mountpath = sys.argv[1]

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Path/Directory Traversal Training

● Videos

   ▪ Secure Code Warrior Path/Directory Traversal Video

● Further Reading

   ▪ OWASP Path Traversal

   ▪ OWASP Input Validation Cheat Sheet

 
HighFile Manipulation

CWE-73

block_cache_linux.go:979

12024-09-13 04:56pm
Vulnerable Code

}
// Dump this block to local disk cache
f, err := os.Create(localPath)
if err == nil {
_, err := f.Write(item.block.data[:n])

1 Data Flow/s detected

f, err := os.Open(localPath)

n, err := f.Read(item.block.data)

_, err := f.Write(item.block.data[:n])

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior File Manipulation Training

● Videos

   ▪ Secure Code Warrior File Manipulation Video

● Further Reading

   ▪ OWASP Path Traversal

   ▪ OWASP Input Validation Cheat Sheet

 
HighInsecure Directory Permissions

CWE-732

mount.go:168

12024-04-02 02:23pm
Vulnerable Code

cloudfuse/cmd/mount.go

Lines 163 to 168 in 9714dd7

return fmt.Errorf("default work dir '%s' is not a directory", common.DefaultWorkDir)
}
if err != nil && os.IsNotExist(err) {
// create the default work dir
if err = os.MkdirAll(common.ExpandPath(common.DefaultWorkDir), 0777); err != nil {

1 Data Flow/s detected

if err = os.MkdirAll(common.ExpandPath(common.DefaultWorkDir), 0777); err != nil {

Secure Code Warrior Training Material
 
HighInsecure Directory Permissions

CWE-732

mount_all.go:329

12024-04-02 02:23pm
Vulnerable Code

cloudfuse/cmd/mount_all.go

Lines 324 to 329 in 9714dd7

if options.SecureConfig {
contConfigFile = contConfigFile + SecureConfigExtension
}
if _, err := os.Stat(contMountPath); os.IsNotExist(err) {
err = os.MkdirAll(contMountPath, 0777)

1 Data Flow/s detected

err = os.MkdirAll(contMountPath, 0777)

Secure Code Warrior Training Material
 
HighFile Manipulation

CWE-73

block_cache_linux.go:1689

12024-04-02 02:23pm
Vulnerable Code

localDstPath := filepath.Join(bc.tmpPath, options.Dst)
files, err := filepath.Glob(localSrcPath + "*")
if err == nil {
for _, f := range files {
err = os.Rename(f, strings.Replace(f, localSrcPath, localDstPath, 1))

1 Data Flow/s detected

f, err := os.Open(localPath)

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior File Manipulation Training

● Videos

   ▪ Secure Code Warrior File Manipulation Video

● Further Reading

   ▪ OWASP Path Traversal

   ▪ OWASP Input Validation Cheat Sheet

 
HighInsecure File Permissions

CWE-732

stats_export.go:278

12024-04-02 02:23pm
Vulnerable Code

fname = fmt.Sprintf("%v_%v.%v", baseName, hmcommon.Pid, hmcommon.OutputFileExtension)
fnameNew = fmt.Sprintf("%v_%v_1.%v", baseName, hmcommon.Pid, hmcommon.OutputFileExtension)
_ = os.Rename(fname, fnameNew)
fname = fmt.Sprintf("%v_%v.%v", baseName, hmcommon.Pid, hmcommon.OutputFileExtension)
se.opFile, err = os.OpenFile(fname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0755)

1 Data Flow/s detected

se.opFile, err = os.OpenFile(fname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0755)

Secure Code Warrior Training Material
 
HighInsecure Directory Permissions

CWE-732

block_cache_linux.go:970

12024-04-02 02:23pm
Vulnerable Code

}
item.block.endIndex = item.block.offset + uint64(n)
if bc.tmpPath != "" {
err := os.MkdirAll(filepath.Dir(localPath), 0777)

1 Data Flow/s detected

err := os.MkdirAll(filepath.Dir(localPath), 0777)

Secure Code Warrior Training Material
 
HighCommand Injection

CWE-78

mount_all.go:363

12024-04-02 02:23pm
Vulnerable Code

cloudfuse/cmd/mount_all.go

Lines 358 to 363 in 9714dd7

updateCliParams(&cliParams, "tmp-path", filepath.Join(fileCachePath, container))
}
// Now that we have mount path and config file for this container fire a mount command for this one
fmt.Println("Mounting container :", container, "to path ", contMountPath)
cmd := exec.Command(mountAllOpts.cloudfuseBinPath, cliParams...)

1 Data Flow/s detected

mountAllOpts.cloudfuseBinPath = os.Args[0]

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Command Injection Training

● Videos

   ▪ Secure Code Warrior Command Injection Video

● Further Reading

   ▪ OWASP testing for Command Injection

   ▪ OWASP Command Injection

Findings Overview

Severity Vulnerability Type CWE Language Count
High Command Injection CWE-78 Go 1
High File Manipulation CWE-73 Go 4
High Path/Directory Traversal CWE-22 Python 2
High Insecure Directory Permissions CWE-732 Go 3
High Insecure File Permissions CWE-732 Go 8
Medium Heap Inspection CWE-244 Go 8
@mend-for-github-com mend-for-github-com bot added the Mend: code security findings Code security findings detected by Mend label Apr 2, 2024
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 15 high severity findings, 40 total findings Code Security Report: 15 high severity findings, 27 total findings Apr 25, 2024
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 15 high severity findings, 27 total findings Code Security Report: 15 high severity findings, 23 total findings May 7, 2024
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 15 high severity findings, 23 total findings Code Security Report: 15 high severity findings, 24 total findings May 30, 2024
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 15 high severity findings, 24 total findings Code Security Report: 15 high severity findings, 29 total findings Jul 2, 2024
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 15 high severity findings, 29 total findings Code Security Report: 15 high severity findings, 24 total findings Jul 23, 2024
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 15 high severity findings, 24 total findings Code Security Report: 18 high severity findings, 28 total findings Sep 25, 2024
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 18 high severity findings, 28 total findings Code Security Report: 18 high severity findings, 27 total findings Nov 8, 2024
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 18 high severity findings, 27 total findings Code Security Report: 18 high severity findings, 26 total findings Dec 20, 2024
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 18 high severity findings, 26 total findings Code Security Report: 18 high severity findings, 26 total findings - autoclosed Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mend: code security findings Code security findings detected by Mend
Projects
None yet
Development

No branches or pull requests

0 participants