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, 27 total findings #177

Open
1 task
mend-for-github-com bot opened this issue Apr 2, 2024 · 0 comments
Open
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: 2024-11-08 09:47pm
Total Findings: 27 | 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 FlowsDate
HighInsecure File Permissions

CWE-732

loopback_fs.go:256

12024-09-18 05:02pm
Vulnerable Code

func (lfs *LoopbackFS) ReadInBuffer(options internal.ReadInBufferOptions) (int, error) {
log.Trace("LoopbackFS::ReadInBuffer : name=%s", options.Handle.Path)
f := options.Handle.GetFileObject()
if f == nil {
f1, err := os.OpenFile(filepath.Join(lfs.path, options.Handle.Path), os.O_RDONLY, 0666)

1 Data Flow/s detected

f1, err := os.OpenFile(filepath.Join(lfs.path, options.Handle.Path), os.O_RDONLY, 0666)

Secure Code Warrior Training Material
 
HighInsecure Directory Permissions

CWE-732

mount.go:168

12024-04-02 02:23pm
Vulnerable Code

cloudfuse/cmd/mount.go

Lines 163 to 168 in 219b0d1

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 219b0d1

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
 
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
 
HighInsecure File Permissions

CWE-732

base_logger.go:130

12024-04-02 02:23pm
Vulnerable Code

l.fileConfig.LogFile = name
if l.logFileHandle != nil {
if name == "stdout" {
l.logFileHandle = os.Stdout
} else {
f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)

1 Data Flow/s detected

f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)

Secure Code Warrior Training Material
 
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
 
HighInsecure File Permissions

CWE-732

stats_manager_linux.go:51

12024-04-02 02:23pm
Vulnerable Code

log.Err("stats_manager::statsDumper : [%v]", err)
disableMonitoring()
return
}
f, err := os.OpenFile(common.TransferPipe, os.O_CREATE|os.O_WRONLY, 0777)

1 Data Flow/s detected

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

Secure Code Warrior Training Material
 
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 File Permissions

CWE-732

stats_reader_linux.go:87

12024-04-02 02:23pm
Vulnerable Code

if err != nil {
log.Err("StatsReader::statsPoll : [%v]", err)
return
}
pf, err := os.OpenFile(cfs.pollingPipe, os.O_CREATE|os.O_WRONLY, 0777)

1 Data Flow/s detected

pf, err := os.OpenFile(cfs.pollingPipe, os.O_CREATE|os.O_WRONLY, 0777)

Secure Code Warrior Training Material
 
HighInsecure File Permissions

CWE-732

cache_policy.go:106

12024-04-02 02:23pm
Vulnerable Code

err := os.Remove(name)
if err != nil && os.IsPermission(err) {
// File is not having delete permissions so change the mode and retry deletion
log.Warn("cachePolicy::deleteFile : failed to delete %s due to permission", name)
err = os.Chmod(name, os.FileMode(0666))

1 Data Flow/s detected

err = os.Chmod(name, os.FileMode(0666))

Secure Code Warrior Training Material

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 Miscellaneous Dangerous Functions CWE-676 Python 1
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
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