Skip to content

Commit

Permalink
sec(codeql): fix potential cross-site scripting vulnerability (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikoksr authored Oct 19, 2022
1 parent 93a1552 commit ce792a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/wechat/wechat.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package wechat
import (
"context"
"fmt"
"html"
"net/http"
"sync"
"time"
Expand Down Expand Up @@ -73,7 +74,7 @@ func (s *Service) waitForOneOffVerification(server *http.Server, devMode bool, c
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()

echoStr := query.Get("echostr")
echoStr := html.EscapeString(query.Get("echostr"))
if devMode {
if callback != nil {
callback(r, true)
Expand Down

0 comments on commit ce792a2

Please sign in to comment.