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: 15 high severity findings, 23 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-05-08 07:30pm
Total Findings: 23 | New Findings: 0 | Resolved Findings: 0
Tested Project Files: 128
Detected Programming Languages: 3 (Python, C/C++ (Beta), Go)

  • 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:279

12024-04-02 02:23pm
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(common.JoinUnixFilepath(lfs.path, options.Handle.Path), os.O_RDONLY, 0777)

1 Data Flow/s detected

f1, err := os.OpenFile(common.JoinUnixFilepath(lfs.path, options.Handle.Path), os.O_RDONLY, 0777)

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

CWE-732

base_logger.go:186

12024-04-02 02:23pm
Vulnerable Code

fi, e := os.Stat(l.fileConfig.LogFile)
if e == nil {
l.fileConfig.currentLogSize = uint64(fi.Size())
}
var err error
l.logFileHandle, err = os.OpenFile(l.fileConfig.LogFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)

1 Data Flow/s detected

l.logFileHandle, err = os.OpenFile(l.fileConfig.LogFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)

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 Directory Permissions

CWE-732

mount.go:142

12024-04-02 02:23pm
Vulnerable Code

cloudfuse/cmd/mount.go

Lines 137 to 142 in d47f0a2

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 d47f0a2

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

Findings Overview

Severity Vulnerability Type CWE Language Count
High Command Injection CWE-78 Go 1
High File Manipulation CWE-73 Go 3
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 7
@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
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