High firefox Integer Overflow 🔧 Commit mapped

Overview

High
Severity
CVSS
No
Exploited ITW
Fixed
Fix Status
Impacthigh
DescriptionSandbox escape due to incorrect boundary conditions, integer overflow in the XPCOM component
ComponentCore
Bug ClassInteger Overflow
Tracker2016375
Fix commit7f3472ccfe11 (firefox) +4/-2
CISA KEVNot listed
CreditedSajeeb Lohani
Disclosed2026-03-24

Files Changed

  • xpcom/io/SnappyUncompressInputStream.cpp
diff --git a/xpcom/io/SnappyUncompressInputStream.cpp b/xpcom/io/SnappyUncompressInputStream.cpp
index 2872c8c7a26..3ab8f794979 100644
--- a/xpcom/io/SnappyUncompressInputStream.cpp
+++ b/xpcom/io/SnappyUncompressInputStream.cpp
@@ -21,7 +21,7 @@ static size_t CompressedBufferLength() {
   static size_t kCompressedBufferLength =
       detail::SnappyFrameUtils::MaxCompressedBufferLength(snappy::kBlockSize);
 
-  MOZ_ASSERT(kCompressedBufferLength > 0);
+  MOZ_ASSERT(kCompressedBufferLength > detail::SnappyFrameUtils::kHeaderLength);
   return kCompressedBufferLength;
 }
 
@@ -287,7 +287,9 @@ nsresult SnappyUncompressInputStream::ParseNextChunk(uint32_t* aBytesReadOut) {
   // We have no decompressed data, but we do know the size of the next chunk.
   // Read at least that much from the base stream.
   uint32_t readLength = mNextChunkDataLength;
-  MOZ_ASSERT(readLength <= CompressedBufferLength());
+  if (readLength > CompressedBufferLength() - kHeaderLength) {
+    return NS_ERROR_CORRUPTED_CONTENT;
+  }
 
   // However, if there is enough data in the base stream, also read the next
   // chunk header.  This helps optimize the stream by avoiding many small reads.
Loading diff…