-
Notifications
You must be signed in to change notification settings - Fork 91
JFMIG - Fix #Artifacts are intermittently being overridden during tra… #1518
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
base: master
Are you sure you want to change the base?
Conversation
…nsfer resulting in artifacts being moved to trashcan
📗 Scan Summary
|
at 🎯 Static Application Security Testing (SAST) Vulnerability
Full descriptionVulnerability Details
OverviewStored Path Traversal is a type of vulnerability that arises when user-controlled Vulnerable examplefunc serveFile(w http.ResponseWriter, r *http.Request) {
row := db.QueryRow("SELECT file_path FROM files WHERE id = 12")
row.Scan(&filePath)
http.ServeFile(w, r, filePath)
}In this example, the RemediationTo mitigate stored path traversal vulnerabilities, it is essential to validate func serveFile(w http.ResponseWriter, r *http.Request) {
row := db.QueryRow("SELECT file_path FROM files WHERE id = ?", r.URL.Query().Get("id"))
row.Scan(&filePath)
+ // Validate file path to prevent directory traversal
+ if strings.Contains(filePath, "..") {
+ http.Error(w, "Invalid file path", http.StatusBadRequest)
+ return
+ }
http.ServeFile(w, r, filePath)
}Code FlowsVulnerable data flow analysis result
|
at 🎯 Static Application Security Testing (SAST) Vulnerability
Full descriptionVulnerability Details
OverviewStored Path Traversal is a type of vulnerability that arises when user-controlled Vulnerable examplefunc serveFile(w http.ResponseWriter, r *http.Request) {
row := db.QueryRow("SELECT file_path FROM files WHERE id = 12")
row.Scan(&filePath)
http.ServeFile(w, r, filePath)
}In this example, the RemediationTo mitigate stored path traversal vulnerabilities, it is essential to validate func serveFile(w http.ResponseWriter, r *http.Request) {
row := db.QueryRow("SELECT file_path FROM files WHERE id = ?", r.URL.Query().Get("id"))
row.Scan(&filePath)
+ // Validate file path to prevent directory traversal
+ if strings.Contains(filePath, "..") {
+ http.Error(w, "Invalid file path", http.StatusBadRequest)
+ return
+ }
http.ServeFile(w, r, filePath)
}Code FlowsVulnerable data flow analysis result
|



…nsfer resulting in artifacts being moved to trashcan