Skip to content

Commit

Permalink
🔒️fix Potentially unsafe quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
TarradeMarc committed Jul 23, 2024
1 parent 9e56601 commit 4573b07
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file modified proxy/wasm/cloud-active-defense.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion proxy/wasm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (ctx *pluginContext) OnTick() {
{":method", "POST"}, {":authority", "configmanager"}, {":path", "/blocklist"}, {"accept", "*/*"},
{"Content-Type", "application/json"},
}
if _, err := proxywasm.DispatchHttpCall("configmanager", requestHeadersBlocklist, []byte("{\"blocklist\":" + string(jsonUpdateBlocklist) + ",\"throttle\":" + string(jsonUpdateThrottleList) + "}"), nil, 5000, callBackSetBlocklist); err != nil {
if _, err := proxywasm.DispatchHttpCall("configmanager", requestHeadersBlocklist, []byte(strings.ReplaceAll("{\"blocklist\":" + string(jsonUpdateBlocklist) + ",\"throttle\":" + string(jsonUpdateThrottleList) + "}", `\`, `\\`)), nil, 5000, callBackSetBlocklist); err != nil {
proxywasm.LogCriticalf("dispatch httpcall failed: %v", err)
}
updateBlocklist = []map[string]string{}
Expand Down

0 comments on commit 4573b07

Please sign in to comment.