diff --git a/third_party/blink/renderer/modules/indexeddb/indexed_db_blink_mojom_traits.cc b/third_party/blink/renderer/modules/indexeddb/indexed_db_blink_mojom_traits.cc index d0966bff0c461..622d2e6aa8b81 100644 --- a/third_party/blink/renderer/modules/indexeddb/indexed_db_blink_mojom_traits.cc +++ b/third_party/blink/renderer/modules/indexeddb/indexed_db_blink_mojom_traits.cc @@ -189,7 +189,23 @@ StructTraits>:: blob_info->file->last_modified = info.LastModified().value_or(base::Time()); } - blob_info->size = info.size(); + // ----------------------------------------------------------------------- + // POC INJECTION (simulated compromised renderer): + // When a blob with the sentinel content type is stored in IndexedDB, + // report size=100 to the browser even though the actual blob content is + // much larger. The browser will write the full blob content to the + // on-disk IDB blob store (WriteBlobToFile takes no size and resolves the + // blob via the registry), but LevelDB will record size=100. On later + // retrieval, BlobReader::Read (DataPipeGetter) reports 100 via the size + // callback but streams the entire on-disk file because it passes + // UINT64_MAX to OpenFileAndReadIntoPipe instead of clamping to + // blob_length_. + // ----------------------------------------------------------------------- + if (info.GetType() == "application/x-poc-mismatch") { + blob_info->size = 100; + } else { + blob_info->size = info.size(); + } blink::String mime_type = info.GetType(); if (mime_type.IsNull()) mime_type = blink::g_empty_string;