diff -Nru cups-2.3.1/debian/changelog cups-2.3.1/debian/changelog --- cups-2.3.1/debian/changelog 2023-09-11 16:30:19.000000000 +0000 +++ cups-2.3.1/debian/changelog 2023-09-15 11:20:26.000000000 +0000 @@ -1,3 +1,12 @@ +cups (2.3.1-9ubuntu1.6) focal-security; urgency=medium + + * SECURITY UPDATE: Postscript parsing heap overflow + - debian/patches/CVE-2023-4504.patch: properly check for end of buffer + in cups/raster-interpret.c. + - CVE-2023-4504 + + -- Marc Deslauriers Fri, 15 Sep 2023 07:20:26 -0400 + cups (2.3.1-9ubuntu1.5) focal-security; urgency=medium * SECURITY UPDATE: recently printed documents authentication issue diff -Nru cups-2.3.1/debian/patches/CVE-2023-4504.patch cups-2.3.1/debian/patches/CVE-2023-4504.patch --- cups-2.3.1/debian/patches/CVE-2023-4504.patch 1970-01-01 00:00:00.000000000 +0000 +++ cups-2.3.1/debian/patches/CVE-2023-4504.patch 2023-09-15 11:20:20.000000000 +0000 @@ -0,0 +1,36 @@ +From a9a7daa77699bd58001c25df8a61a8029a217ddf Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Fri, 1 Sep 2023 16:47:29 +0200 +Subject: [PATCH] raster-interpret.c: Fix CVE-2023-4504 + +We didn't check for end of buffer if it looks there is an escaped +character - check for NULL terminator there and if found, return NULL +as return value and in `ptr`, because a lone backslash is not +a valid PostScript character. +--- + cups/raster-interpret.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +--- a/cups/raster-interpret.c ++++ b/cups/raster-interpret.c +@@ -1113,7 +1113,19 @@ scan_ps(_cups_ps_stack_t *st, /* I - S + + cur ++; + +- if (*cur == 'b') ++ /* ++ * Return NULL if we reached NULL terminator, a lone backslash ++ * is not a valid character in PostScript. ++ */ ++ ++ if (!*cur) ++ { ++ *ptr = NULL; ++ ++ return (NULL); ++ } ++ ++ if (*cur == 'b') + *valptr++ = '\b'; + else if (*cur == 'f') + *valptr++ = '\f'; diff -Nru cups-2.3.1/debian/patches/series cups-2.3.1/debian/patches/series --- cups-2.3.1/debian/patches/series 2023-09-11 16:30:10.000000000 +0000 +++ cups-2.3.1/debian/patches/series 2023-09-15 11:20:20.000000000 +0000 @@ -43,3 +43,4 @@ CVE-2023-32324.patch CVE-2023-34241.patch CVE-2023-32360.patch +CVE-2023-4504.patch