Skip to content

Origin Validation Error [VID:346:github.com/govwa/util/template.go:26] #5

Open
@veracode-workflow-app

Description

@veracode-workflow-app

govwa//util/template.go

Lines 21 to 31 in 06b43e3

log.Println(err.Error())
}
}
func RenderAsJson(w http.ResponseWriter, data ...interface{}) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Credentials", "true")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET")
w.Header().Set("Content-Type", "application/json")
b, err := json.Marshal(data)
if err != nil {

Filename: github.com/govwa/util/template.go

Line: 26

CWE: 346 (Origin Validation Error)

Not restricting access to web resources, opens it up for attackers to inadvertently access restricted resources. An application should always check the origin of a request to be coming from a trusted source, before serving it. Please restrict the allowed domains which can access this resource. References: CWE 346/nDon't know how to fix this? Don't know why this was reported?
Get Assistance from Veracode

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions