From ccf3cffe819616b39374594a7b5389fc2d49260d Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Thu, 9 Apr 2026 13:21:33 -0400
Subject: [PATCH] 
 https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-r83h-crwp-3vm7

---
 magick/property.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

Index: ImageMagick-6.8.8-1/magick/property.c
===================================================================
--- ImageMagick-6.8.8-1.orig/magick/property.c
+++ ImageMagick-6.8.8-1/magick/property.c
@@ -1629,14 +1629,26 @@ static MagickBooleanType GetXMPProperty(
       description=GetXMLTreeChild(rdf,"rdf:Description");
       while (description != (XMLTreeInfo *) NULL)
       {
+        char
+          *property;
+
+        size_t
+          property_length;
+
         node=GetXMLTreeChild(description,(const char *) NULL);
         while (node != (XMLTreeInfo *) NULL)
         {
           child=GetXMLTreeChild(node,(const char *) NULL);
           if (child == (XMLTreeInfo *) NULL)
-            (void) AddValueToSplayTree((SplayTreeInfo *) image->properties,
-              ConstantString(GetXMLTreeTag(node)),
-              ConstantString(GetXMLTreeContent(node)));
+            {
+              property=ConstantString(GetXMLTreeTag(node));
+              property_length=strlen(property);
+              if ((property_length <= 2) || (*(property+(property_length-2)) != ':') ||
+                  (*(property+(property_length-1)) != '*'))
+                (void) AddValueToSplayTree((SplayTreeInfo *) image->properties,
+                 ConstantString(property),ConstantString(GetXMLTreeContent(node)));
+              property=DestroyString(property);
+            }
           while (child != (XMLTreeInfo *) NULL)
           {
             if (LocaleCompare(GetXMLTreeTag(child),"rdf:Seq") != 0)
