diff options
| -rw-r--r-- | meta-oe/recipes-support/imagemagick/files/CVE-2025-68618.patch | 95 | ||||
| -rw-r--r-- | meta-oe/recipes-support/imagemagick/imagemagick_7.0.10.bb | 1 |
2 files changed, 96 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/imagemagick/files/CVE-2025-68618.patch b/meta-oe/recipes-support/imagemagick/files/CVE-2025-68618.patch new file mode 100644 index 0000000000..c846b0cc31 --- /dev/null +++ b/meta-oe/recipes-support/imagemagick/files/CVE-2025-68618.patch | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | From 6f431d445f3ddd609c004a1dde617b0a73e60beb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Cristy <urban-warrior@imagemagick.org> | ||
| 3 | Date: Sun, 21 Dec 2025 12:43:08 -0500 | ||
| 4 | |||
| 5 | Subject: [PATCH] imagemagick: Fix CVE-2025-68618 | ||
| 6 | CVE: CVE-2025-68618 | ||
| 7 | Upstream-Status: Backport [https://github.com/ImageMagick/ImageMagick/commit/6f431d445f3ddd609c004a1dde617b0a73e60beb] | ||
| 8 | Signed-off-by: Nitin Wankhade <nitin.wankhade333@gmail.com> | ||
| 9 | === | ||
| 10 | diff --git a/coders/msl.c b/coders/msl.c | ||
| 11 | index 68abd7d..0e8f632 100644 | ||
| 12 | --- a/coders/msl.c | ||
| 13 | +++ b/coders/msl.c | ||
| 14 | @@ -126,6 +126,7 @@ typedef struct _MSLInfo | ||
| 15 | |||
| 16 | ssize_t | ||
| 17 | n, | ||
| 18 | + depth, | ||
| 19 | number_groups; | ||
| 20 | |||
| 21 | ImageInfo | ||
| 22 | @@ -660,13 +661,13 @@ static void MSLStartElement(void *context,const xmlChar *tag, | ||
| 23 | RectangleInfo | ||
| 24 | geometry; | ||
| 25 | |||
| 26 | - ssize_t | ||
| 27 | - i; | ||
| 28 | - | ||
| 29 | size_t | ||
| 30 | height, | ||
| 31 | width; | ||
| 32 | |||
| 33 | + ssize_t | ||
| 34 | + i; | ||
| 35 | + | ||
| 36 | /* | ||
| 37 | Called when an opening tag has been processed. | ||
| 38 | */ | ||
| 39 | @@ -674,6 +675,13 @@ static void MSLStartElement(void *context,const xmlChar *tag, | ||
| 40 | " SAX.startElement(%s",tag); | ||
| 41 | exception=AcquireExceptionInfo(); | ||
| 42 | msl_info=(MSLInfo *) context; | ||
| 43 | + if (msl_info->depth++ >= MagickMaxRecursionDepth) | ||
| 44 | + { | ||
| 45 | + (void) ThrowMagickException(msl_info->exception,GetMagickModule(), | ||
| 46 | + DrawError,"VectorGraphicsNestedTooDeeply","`%s'",tag); | ||
| 47 | + xmlStopParser((xmlParserCtxtPtr) context); | ||
| 48 | + return; | ||
| 49 | + } | ||
| 50 | n=msl_info->n; | ||
| 51 | keyword=(const char *) NULL; | ||
| 52 | value=(char *) NULL; | ||
| 53 | @@ -7430,12 +7438,12 @@ static void MSLStartElement(void *context,const xmlChar *tag, | ||
| 54 | |||
| 55 | static void MSLEndElement(void *context,const xmlChar *tag) | ||
| 56 | { | ||
| 57 | - ssize_t | ||
| 58 | - n; | ||
| 59 | - | ||
| 60 | MSLInfo | ||
| 61 | *msl_info; | ||
| 62 | |||
| 63 | + ssize_t | ||
| 64 | + n; | ||
| 65 | + | ||
| 66 | /* | ||
| 67 | Called when the end of an element has been detected. | ||
| 68 | */ | ||
| 69 | @@ -7525,6 +7533,7 @@ static void MSLEndElement(void *context,const xmlChar *tag) | ||
| 70 | } | ||
| 71 | if (msl_info->content != (char *) NULL) | ||
| 72 | msl_info->content=DestroyString(msl_info->content); | ||
| 73 | + msl_info->depth--; | ||
| 74 | } | ||
| 75 | |||
| 76 | static void MSLCharacters(void *context,const xmlChar *c,int length) | ||
| 77 | diff --git a/coders/svg.c b/coders/svg.c | ||
| 78 | index 5caf8af..ab139e2 100644 | ||
| 79 | --- a/coders/svg.c | ||
| 80 | +++ b/coders/svg.c | ||
| 81 | @@ -1270,7 +1270,13 @@ static void SVGStartElement(void *context,const xmlChar *name, | ||
| 82 | (void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.startElement(%s", | ||
| 83 | name); | ||
| 84 | svg_info=(SVGInfo *) context; | ||
| 85 | - svg_info->n++; | ||
| 86 | + if (svg_info->n++ > MagickMaxRecursionDepth) | ||
| 87 | + { | ||
| 88 | + (void) ThrowMagickException(svg_info->exception,GetMagickModule(), | ||
| 89 | + DrawError,"VectorGraphicsNestedTooDeeply","`%s'",name); | ||
| 90 | + xmlStopParser((xmlParserCtxtPtr) context); | ||
| 91 | + return; | ||
| 92 | + } | ||
| 93 | svg_info->scale=(double *) ResizeQuantumMemory(svg_info->scale, | ||
| 94 | svg_info->n+1UL,sizeof(*svg_info->scale)); | ||
| 95 | if (svg_info->scale == (double *) NULL) | ||
diff --git a/meta-oe/recipes-support/imagemagick/imagemagick_7.0.10.bb b/meta-oe/recipes-support/imagemagick/imagemagick_7.0.10.bb index 7b2d33ccb8..1afc8bbe2c 100644 --- a/meta-oe/recipes-support/imagemagick/imagemagick_7.0.10.bb +++ b/meta-oe/recipes-support/imagemagick/imagemagick_7.0.10.bb | |||
| @@ -50,6 +50,7 @@ SRC_URI = "git://github.com/ImageMagick/ImageMagick.git;branch=main;protocol=htt | |||
| 50 | file://CVE-2025-62171.patch \ | 50 | file://CVE-2025-62171.patch \ |
| 51 | file://CVE-2025-43965.patch \ | 51 | file://CVE-2025-43965.patch \ |
| 52 | file://CVE-2025-66628.patch \ | 52 | file://CVE-2025-66628.patch \ |
| 53 | file://CVE-2025-68618.patch \ | ||
| 53 | " | 54 | " |
| 54 | 55 | ||
| 55 | SRCREV = "35b4991eb0939a327f3489988c366e21068b0178" | 56 | SRCREV = "35b4991eb0939a327f3489988c366e21068b0178" |
