Skip to content

Commit

Permalink
fix codeql security issue (vmware-tanzu#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpanchajanya authored Aug 1, 2023
1 parent 530ee20 commit a56d097
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/auth/csp/selfmanaged.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package csp
import (
"context"
"fmt"
"html"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -63,7 +64,7 @@ func callbackHandler(w http.ResponseWriter, r *http.Request) {
defer tokenExchangeComplete()
code := r.URL.Query().Get("code")
if code == "" {
errMsg := fmt.Sprintf("[state] query params is required, URL %s did not have this query parameters", r.URL.String())
errMsg := fmt.Sprintf("[state] query params is required, URL %s did not have this query parameters", html.EscapeString(r.URL.String()))
http.Error(w, errMsg, http.StatusBadRequest)
log.Info(errMsg)
return
Expand Down

0 comments on commit a56d097

Please sign in to comment.