From 559feb26dfef6ba2f4b7d05d7108d5e98f0e48c2 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Sun, 16 Jan 2022 22:29:22 +0100 Subject: [PATCH] Break reading iptc data when Extended data set tag is encountered --- src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs b/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs index d07cb11c9..945d5d103 100644 --- a/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs +++ b/src/ImageSharp/Metadata/Profiles/IPTC/IptcProfile.cs @@ -282,6 +282,11 @@ namespace SixLabors.ImageSharp.Metadata.Profiles.Iptc uint byteCount = BinaryPrimitives.ReadUInt16BigEndian(this.Data.AsSpan(offset, 2)); offset += 2; + if (byteCount > MaxStandardDataTagSize) + { + // Extended data set tag's are not supported. + break; + } if (isValidTagMarker && byteCount > 0 && (offset + byteCount <= this.Data.Length)) {