π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[server] Add input sanitization for Listmonk API calls
Neeraj Gupta3bdd5d36d3c3
diff --git a/server/pkg/external/listmonk/api.go b/server/pkg/external/listmonk/api.goindex 338a54c3ec..f72b267132 100644--- a/server/pkg/external/listmonk/api.go+++ b/server/pkg/external/listmonk/api.go@@ -7,6 +7,7 @@ import ("io""net/http""net/url"+ "strings""github.com/ente-io/stacktrace")@@ -37,8 +38,10 @@ func GetSubscriberID(endpoint string, username string, password string, subscrib}// Constructing query parameters+ // Escape single quotes to prevent SQL-like injection in Listmonk's query syntax+ sanitizedEmail := strings.ReplaceAll(subscriberEmail, "'", "''")queryParams := url.Values{}- queryParams.Set("query", fmt.Sprintf("subscribers.email = '%s'", subscriberEmail))+ queryParams.Set("query", fmt.Sprintf("subscribers.email = '%s'", sanitizedEmail))// Constructing the URL with query parametersendpointURL, err := url.Parse(endpoint)