-
Notifications
You must be signed in to change notification settings - Fork 87
Deprecate all multi commands #941
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: v3_er
Are you sure you want to change the base?
Conversation
eyalk007
commented
Oct 28, 2025
- All tests passed. If this feature is not already covered by the tests, I added new tests.
- This pull request is on the dev branch.
- I used gofmt for formatting the code before submitting the pull request.
- Update documentation about new features / new supported technologies
This reverts commit c7fa431.
138037f to
c8230ac
Compare
📗 Scan Summary
|
at 🎯 Static Application Security Testing (SAST) VulnerabilityFull descriptionVulnerability Details
OverviewUnsafe deserialization in Go occurs when a program deserializes untrusted Vulnerable exampleimport (
"github.com/go-yaml/yaml"
"net/http"
)
func storeHandler(w http.ResponseWriter, r *http.Request) {
var data map[string]interface{}
yaml.Unmarshal([]byte(r.URL.Query().Get("data")), &data) // NOT OK
}This code uses Remediationimport (
"github.com/go-yaml/yaml"
"net/http"
)
func storeHandler(w http.ResponseWriter, r *http.Request) {
var data map[string]interface{}
yaml.UnmarshalStrict([]byte(r.URL.Query().Get("data")), &data) // SAFE
}Using Code FlowsVulnerable data flow analysis result
|
at 🎯 Static Application Security Testing (SAST) VulnerabilityFull descriptionVulnerability Details
OverviewStored Cross-Site Scripting (XSS) is a type of vulnerability where malicious Vulnerable examplefunc serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
fmt.Fprintf(w, "<h1>%s</h1>", message)
}In this example, the RemediationTo mitigate Stored XSS vulnerabilities, always sanitize and encode user func serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
- fmt.Fprintf(w, "<h1>%s</h1>", message)
+ fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}In the remediation, we've used the Code FlowsVulnerable data flow analysis result
|
at 🎯 Static Application Security Testing (SAST) VulnerabilityFull descriptionVulnerability Details
OverviewStored Cross-Site Scripting (XSS) is a type of vulnerability where malicious Vulnerable examplefunc serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
fmt.Fprintf(w, "<h1>%s</h1>", message)
}In this example, the RemediationTo mitigate Stored XSS vulnerabilities, always sanitize and encode user func serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
- fmt.Fprintf(w, "<h1>%s</h1>", message)
+ fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}In the remediation, we've used the Code FlowsVulnerable data flow analysis result
|
| if r.RequestURI == fmt.Sprintf("/%s", projectName) { | ||
| file, err := os.ReadFile(fmt.Sprintf("%s.tar.gz", projectName)) | ||
| assert.NoError(t, err) | ||
| _, err = w.Write(file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Static Application Security Testing (SAST) Vulnerability
Full description
Vulnerability Details
| Rule ID: | go-stored-xss |
Overview
Stored Cross-Site Scripting (XSS) is a type of vulnerability where malicious
scripts are injected into a web application and stored in a persistent state,
such as a database. When other users access the affected page, the stored
scripts are executed in their browsers, leading to various attacks.
Vulnerable example
func serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
fmt.Fprintf(w, "<h1>%s</h1>", message)
}In this example, the serveMessage function retrieves a message from the
database and directly embeds it into an HTML response without proper escaping.
If the message contains malicious scripts, it can lead to Stored XSS attacks
when other users view the page.
Remediation
To mitigate Stored XSS vulnerabilities, always sanitize and encode user
input before storing it in a persistent state and before displaying it
to other users:
func serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
- fmt.Fprintf(w, "<h1>%s</h1>", message)
+ fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}In the remediation, we've used the html.EscapeString function to escape
the message before embedding it into the HTML response. This helps prevent
the execution of malicious scripts and mitigates the Stored XSS vulnerability.
Code Flows
Vulnerable data flow analysis result
os.ReadFile(fmt.Sprintf("%s.tar.gz", projectName)) (at scanrepository/scanrepository_test.go line 855)
file (at scanrepository/scanrepository_test.go line 855)
file (at scanrepository/scanrepository_test.go line 857)
at 🎯 Static Application Security Testing (SAST) VulnerabilityFull descriptionVulnerability Details
OverviewStored Cross-Site Scripting (XSS) is a type of vulnerability where malicious Vulnerable examplefunc serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
fmt.Fprintf(w, "<h1>%s</h1>", message)
}In this example, the RemediationTo mitigate Stored XSS vulnerabilities, always sanitize and encode user func serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
- fmt.Fprintf(w, "<h1>%s</h1>", message)
+ fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}In the remediation, we've used the Code FlowsVulnerable data flow analysis result
|
at 🎯 Static Application Security Testing (SAST) VulnerabilityFull descriptionVulnerability Details
OverviewStored Cross-Site Scripting (XSS) is a type of vulnerability where malicious Vulnerable examplefunc serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
fmt.Fprintf(w, "<h1>%s</h1>", message)
}In this example, the RemediationTo mitigate Stored XSS vulnerabilities, always sanitize and encode user func serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
- fmt.Fprintf(w, "<h1>%s</h1>", message)
+ fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}In the remediation, we've used the Code FlowsVulnerable data flow analysis result
|
at 🎯 Static Application Security Testing (SAST) VulnerabilityFull descriptionVulnerability Details
OverviewStored Cross-Site Scripting (XSS) is a type of vulnerability where malicious Vulnerable examplefunc serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
fmt.Fprintf(w, "<h1>%s</h1>", message)
}In this example, the RemediationTo mitigate Stored XSS vulnerabilities, always sanitize and encode user func serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
- fmt.Fprintf(w, "<h1>%s</h1>", message)
+ fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}In the remediation, we've used the Code FlowsVulnerable data flow analysis result
|
at 🎯 Static Application Security Testing (SAST) VulnerabilityFull descriptionVulnerability Details
OverviewStored Cross-Site Scripting (XSS) is a type of vulnerability where malicious Vulnerable examplefunc serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
fmt.Fprintf(w, "<h1>%s</h1>", message)
}In this example, the RemediationTo mitigate Stored XSS vulnerabilities, always sanitize and encode user func serveMessage(w http.ResponseWriter, r *http.Request) {
db, _ := sql.Open("sqlite3", "test.db")
message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
- fmt.Fprintf(w, "<h1>%s</h1>", message)
+ fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}In the remediation, we've used the Code FlowsVulnerable data flow analysis result
|


