Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

s3: fix potentially unsafe quoting issue

albertonya87d8967fc2e
diff --git a/backend/s3/s3.go b/backend/s3/s3.go
index 8278d4d08..e5810cfc2 100644
--- a/backend/s3/s3.go
+++ b/backend/s3/s3.go
@@ -3215,7 +3215,7 @@ func setEndpointValueForIDriveE2(m configmap.Mapper) (err error) {
// API to get user region endpoint against the Access Key details: https://www.idrive.com/e2/guides/get_region_endpoint
resp, err := client.Post("https://api.idrivee2.com/api/service/get_region_end_point",
"application/json",
- strings.NewReader(`{"access_key": "`+value+`"}`))
+ strings.NewReader(`{"access_key": `+strconv.Quote(value)+`}`))
if err != nil {
return
}