ANT-2026-G7GNYY68 · libreoffice/core

oob-write medium

CVE-2026-6045

Severity Claude high · Security research firm high · Maintainer medium

Discovered by Claude Mythos Preview

REPORT

Anthropic's analysis, sealed at approval. Disclosure to the maintainer was performed by Ada Logics.

ANT-2026-G7GNYY68: Heap Buffer Overflow via Integer Overflow in EMF+ Brush Blend Point Parsing

An integer overflow during parsing of EMF+ brush blend points leads to a heap buffer overflow.

Target

Project: libreoffice/core
Location: drawinglayer/source/tools/emfpbrush.cxx:EMFPBrush::Read
Discovery: static analysis — not yet dynamically reproduced

Reproduction

This finding was identified by static analysis and has not yet been dynamically reproduced. A trigger input is not included.

[No reproducer or sanitizer output attached — request from security-cvd@anthropic.com if needed.]

Acknowledgement

This vulnerability was discovered by Claude, Anthropic's AI assistant, and triaged by the Anthropic security team in collaboration with Anthropic Research. Please direct questions to security-cvd@anthropic.com and reference ANT-2026-G7GNYY68.


Reference: ANT-2026-G7GNYY68
Anthropic CVD Policy: https://www.anthropic.com/coordinated-vulnerability-disclosure

SECURITY RESEARCH FIRM ANALYSIS

Triage and disclosure were performed by Ada Logics.

Verdict
true positive
Severity
high
UPSTREAM FIX

The change that resolved this finding.

diff --git a/drawinglayer/source/tools/emfpbrush.cxx b/drawinglayer/source/tools/emfpbrush.cxx
index 51fce424b70a4..fe910e4e56e0d 100644
--- a/drawinglayer/source/tools/emfpbrush.cxx
+++ b/drawinglayer/source/tools/emfpbrush.cxx
@@ -62,7 +62,7 @@ namespace emfplushelper
 
     void EMFPBrush::Read(SvMemoryStream& s, EmfPlusHelperData const & rR, sal_uInt32 dataSize, bool bUseWholeStream)
     {
-        sal_uInt32 header;
+        sal_uInt32 header(0);
 
         s.ReadUInt32(header).ReadUInt32(type);
 
@@ -73,7 +73,7 @@ namespace emfplushelper
         {
             case BrushTypeSolidColor:
             {
-                sal_uInt32 color;
+                sal_uInt32 color(0);
                 s.ReadUInt32(color);
 
                 solidColor = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
@@ -82,9 +82,9 @@ namespace emfplushelper
             }
             case BrushTypeHatchFill:
             {
-                sal_uInt32 style;
-                sal_uInt32 foregroundColor;
-                sal_uInt32 backgroundColor;
+                sal_uInt32 style(0);
+                sal_uInt32 foregroundColor(0);
+                sal_uInt32 backgroundColor(0);
                 s.ReadUInt32(style);
                 s.ReadUInt32(foregroundColor);
                 s.ReadUInt32(backgroundColor);
@@ -120,7 +120,7 @@ namespace emfplushelper
             {
                 s.ReadUInt32(additionalFlags).ReadInt32(wrapMode);
                 SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tAdditional flags: 0x" << std::hex << additionalFlags << std::dec);
-                sal_uInt32 color;
+                sal_uInt32 color(0);
                 s.ReadUInt32(color);
                 solidColor = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
                 SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tCenter color: 0x" << std::hex << color << std::dec);
@@ -129,6 +129,12 @@ namespace emfplushelper
                 s.ReadUInt32(surroundColorsNumber);
                 SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\t number of surround colors: " << surroundColorsNumber);
 
+                if (surroundColorsNumber > s.remainingSize() / sizeof(sal_uInt32))
+                {
+                    SAL_WARN("drawinglayer.emf", "EMF+\t\t\t\tTruncated surround colors");
+                    return;
+                }
+
                 surroundColors.reset( new ::Color[surroundColorsNumber] );
 
                 for (sal_uInt32 i = 0; i < surroundColorsNumber; i++)
@@ -142,15 +148,15 @@ namespace emfplushelper
 
                 if (additionalFlags & 0x01) // BrushDataPath
                 {
-                    sal_Int32 pathLength;
+                    sal_Int32 pathLength(0);
 
                     s.ReadInt32(pathLength);
                     SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tPath length: " << pathLength);
 
                     sal_uInt64 const pos = s.Tell();
 
-                    sal_uInt32 pathHeader;
-                    sal_Int32 pathPoints, pathFlags;
+                    sal_uInt32 pathHeader(0);
+                    sal_Int32 pathPoints(0), pathFlags(0);
                     s.ReadUInt32(pathHeader).ReadInt32(pathPoints).ReadInt32(pathFlags);
 
                     SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tPath (brush path gradient)");
@@ -171,7 +177,7 @@ namespace emfplushelper
                 }
                 else
                 {
-                    sal_Int32 boundaryPointCount;
+                    sal_Int32 boundaryPointCount(0);
                     s.ReadInt32(boundaryPointCount);
 
                     sal_uInt64 const pos = s.Tell();
@@ -205,6 +211,13 @@ namespace emfplushelper
                 {
                     s.ReadUInt32(blendPoints);
                     SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tuse blend, points: " << blendPoints);
+
+                    if (blendPoints > s.remainingSize() / (2 * sizeof(float)))
+                    {
+                        SAL_WARN("drawinglayer.emf", "EMF+\t\t\t\tTruncated blend points");
+                        return;
+                    }
+
                     blendPositions.reset( new float[2 * blendPoints] );
                     blendFactors = blendPositions.get() + blendPoints;
 
@@ -225,6 +238,13 @@ namespace emfplushelper
                 {
                     s.ReadUInt32(colorblendPoints);
                     SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tUse color blend, points: " << colorblendPoints);
+
+                    if (colorblendPoints > s.remainingSize() / (sizeof(float) + sizeof(sal_uInt32)))
+                    {
+                        SAL_WARN("drawinglayer.emf", "EMF+\t\t\t\tTruncated color blend points");
+                        return;
+                    }
+
                     colorblendPositions.reset( new float[colorblendPoints] );
                     colorblendColors.reset( new ::Color[colorblendPoints] );
 
@@ -251,7 +271,7 @@ namespace emfplushelper
                 s.ReadFloat(firstPointX).ReadFloat(firstPointY).ReadFloat(aWidth).ReadFloat(aHeight);
                 SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tFirst gradient point: " << firstPointX << ":" << firstPointY
                                          << ", size " << aWidth << "x" << aHeight);
-                sal_uInt32 color;
+                sal_uInt32 color(0);
                 s.ReadUInt32(color);
                 solidColor = ::Color(ColorAlpha, (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
                 SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tfirst color: 0x" << std::hex << color << std::dec);
@@ -280,6 +300,13 @@ namespace emfplushelper
                 {
                     s.ReadUInt32(blendPoints);
                     SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tUse blend, points: " << blendPoints);
+
+                    if (blendPoints > s.remainingSize() / (2 * sizeof(float)))
+                    {
+                        SAL_WARN("drawinglayer.emf", "EMF+\t\t\t\tTruncated blend points");
+                        return;
+                    }
+
                     blendPositions.reset( new float[2 * blendPoints] );
                     blendFactors = blendPositions.get() + blendPoints;
 
@@ -300,6 +327,13 @@ namespace emfplushelper
                 {
                     s.ReadUInt32(colorblendPoints);
                     SAL_INFO("drawinglayer.emf", "EMF+\t\t\t\tUse color blend, points: " << colorblendPoints);
+
+                    if (colorblendPoints > s.remainingSize() / (sizeof(float) + sizeof(sal_uInt32)))
+                    {
+                        SAL_WARN("drawinglayer.emf", "EMF+\t\t\t\tTruncated color blend points");
+                        return;
+                    }
+
                     colorblendPositions.reset( new float[colorblendPoints] );
                     colorblendColors.reset( new ::Color[colorblendPoints] );
 

https://github.com/LibreOffice/core/commit/0e2682488ba3830db4601a949500588334c938c0

TIMELINE

Recorded dates, in order.

  1. 2026-03-29 Discovered or logged
  2. 2026-04-09 Sent to maintainer
  3. 2026-04-30 Patch released
  4. 2026-05-09 Maintainer acknowledged
  5. 2026-08-17 Publicly revealed
PROVENANCE

SHA-3-512 hash:

d3fd15b9dba2859842eca0b54091853a125bd20ca023ce3b82e5a4d1cccd8c92384c803858f19b22b61c66823161cb21ee42fe234e93b24e86b1efb9faab8469

Committed 2026-04-09 18:50 UTC

Revealed 2026-08-17 21:12 UTC

Verify (download preimage.json)

Show preimage JSON
{
  "ant_id": "ANT-2026-G7GNYY68",
  "bug_class": "Heap Buffer Overflow",
  "claude_severity": "high",
  "commit_sha": null,
  "created_at": "2026-03-29T20:43:12+00:00",
  "description": "An integer overflow during parsing of EMF+ brush blend points leads to a heap buffer overflow.",
  "discovered_at": null,
  "location": null,
  "poc_sha256": null,
  "preimage_version": 1,
  "project": "LibreOffice",
  "reproduction": null,
  "technical_details": null,
  "title": "Heap Buffer Overflow via Integer Overflow in EMF+ Brush Blend Point Parsing",
  "vendor_severity": "high"
}