From 4804f1f1e9d1672483873ea4aefc5969c079aed7 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Thu, 15 Aug 2024 20:14:58 +0200 Subject: [PATCH] dropbox: fix potentially unsafe quoting issue --- backend/dropbox/dropbox.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/dropbox/dropbox.go b/backend/dropbox/dropbox.go index 28eaa30be..f2f1fc852 100644 --- a/backend/dropbox/dropbox.go +++ b/backend/dropbox/dropbox.go @@ -386,7 +386,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e oldToken = strings.TrimSpace(oldToken) if ok && oldToken != "" && oldToken[0] != '{' { fs.Infof(name, "Converting token to new format") - newToken := fmt.Sprintf(`{"access_token":"%s","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}`, oldToken) + newToken := fmt.Sprintf(`{"access_token":%q,"token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}`, oldToken) err := config.SetValueAndSave(name, config.ConfigToken, newToken) if err != nil { return nil, fmt.Errorf("NewFS convert token: %w", err)