endpointlabs / VulnerableDotNetCore3Project

.Net Core 3.0
0 stars 0 forks source link

Errors unhandled. (CWE-703) #52

Closed cbilgin23 closed 2 years ago

cbilgin23 commented 2 years ago

Due Date: 2022-10-20

A low severity vulnerability has been discovered in your project.

Project Name: twrap-go

Scanner Name: gosec

Cwe ID: 703

Cwe Name: Improper Check or Handling of Exceptional Conditions

Cwe Link: https://cwe.mitre.org/data/definitions/703.html

File: web/mv.go

Line: 1353

Code:

-1348 -     if contentType != fileType {
-1349 -         return errors.New("invalid file type")
-1350 -     }
-1351 - 
-1352 -     h256 := sha256.New()
*1353 -     h256.Write([]byte(strconv.FormatInt(time.Now().UnixNano(), 10)))
-1354 -     hash := fmt.Sprintf("%x", h256.Sum(nil))
-1355 -     if hash == "" {
-1356 -         return errors.New("invalid source hash")
-1357 -     }
-1358 - 
-1359 -     konduktoRoot := common.Dir()


Language: go

Commit Author: Yusuf

Commit Link: (https://github.com/endpointlabs/twrap-go/commit/2a5934f42d9e6c1b2325bd2ff91f6cb8b3d106ca)

Tool Description: Errors unhandled.

Custom Description: test

Kondukto Link: http://79.kondukto.local/projects/634fe837a5be8478724352c4/vulns/appsec?page=1&perPage=15&id=in:6350011ade2a84ccb325bc6d Deeplink: https://cwe.mitre.org/data/definitions/703.html

cbilgin23 commented 2 years ago

test