summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2023-03-15 10:51:16 +0000
committerSimon McVittie <smcv@collabora.com>2023-03-16 09:54:14 +0000
commit409e34187de2b2b2c4ef34c79f417be698830f6c (patch)
treed1a77a68a4a42a96a7db2f17e93d8742c77e4148
parent7fe63f2e8f1fd2dafc31d45154cf0b191ebec66c (diff)
downloadflatpak-409e34187de2b2b2c4ef34c79f417be698830f6c.tar.gz
cli-transaction: Escape any special characters in the EOL reason
CVE-2023-28101, GHSA-h43h-fwqx-mpp8 Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--app/flatpak-cli-transaction.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/flatpak-cli-transaction.c b/app/flatpak-cli-transaction.c
index 53593bfc..829f44b2 100644
--- a/app/flatpak-cli-transaction.c
+++ b/app/flatpak-cli-transaction.c
@@ -755,6 +755,9 @@ print_eol_info_message (FlatpakDir *dir,
}
else if (reason)
{
+ g_autofree char *escaped_reason = flatpak_escape_string (reason,
+ FLATPAK_ESCAPE_ALLOW_NEWLINES |
+ FLATPAK_ESCAPE_DO_NOT_QUOTE);
if (is_pinned)
{
/* Only runtimes can be pinned */
@@ -770,7 +773,7 @@ print_eol_info_message (FlatpakDir *dir,
g_print (_("\nInfo: app %s%s%s branch %s%s%s is end-of-life, with reason:\n"),
on, ref_name, off, on, ref_branch, off);
}
- g_print (" %s\n", reason);
+ g_print (" %s\n", escaped_reason);
}
}