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 cleanup #414

Merged
merged 6 commits into from
Jan 15, 2025

Use context background when creating daemon

26ad31c
Select commit
Loading
Failed to load commit list.
Merged

Code cleanup #414

Use context background when creating daemon
26ad31c
Select commit
Loading
Failed to load commit list.
Mend for GitHub.com / Mend Code Security Check failed Jan 15, 2025 in 1m 19s

Code Security Report

New findings (4)

The Code Security Check detected a total of 4 new findings.

SeverityVulnerability TypeCWEFileData FlowsDetected
HighInsecure Directory Permissions

CWE-732

block_cache_linux.go:970

12025-01-14 09:10pm
Vulnerable Code

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

1 Data Flow/s detected

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

Secure Code Warrior Training Material
 
HighInsecure Directory Permissions

CWE-732

mount.go:168

12025-01-14 09:10pm
Vulnerable Code

cloudfuse/cmd/mount.go

Lines 163 to 168 in 26ad31c

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), 0755); err != nil {

1 Data Flow/s detected

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

Secure Code Warrior Training Material
 
HighInsecure File Permissions

CWE-732

stats_export.go:278

12025-01-14 09:10pm
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, 0644)

1 Data Flow/s detected

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

Secure Code Warrior Training Material
 
HighInsecure File Permissions

CWE-732

stats_reader_linux.go:87

12025-01-14 09:10pm
Vulnerable Code

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

1 Data Flow/s detected

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

Secure Code Warrior Training Material

Resolved findings (7)

With your last commit you resolved 7 findings.

SeverityVulnerability TypeCWEFileData FlowsDetected
HighInsecure Directory Permissions

CWE-732

mount.go:168

12024-04-02 02:23pm
HighInsecure Directory Permissions

CWE-732

block_cache_linux.go:970

12024-04-02 02:23pm
HighInsecure File Permissions

CWE-732

stats_manager_linux.go:160

12024-04-02 02:23pm
HighInsecure File Permissions

CWE-732

stats_export.go:278

12024-04-02 02:23pm
HighInsecure File Permissions

CWE-732

stats_manager_linux.go:51

12024-04-02 02:23pm
HighInsecure File Permissions

CWE-732

stats_reader_linux.go:87

12024-04-02 02:23pm
HighInsecure File Permissions

CWE-732

loopback_fs.go:256

12024-09-18 05:02pm

Overall findings

The Code Security Check detected a total of 23 findings, 15 of them high severity. More details about the overall state can be found in the Mend Application.


Scan token: f63c9b898a94475c97e045ed7eec99bd