RESOLVED FIXED308712
Binary key over-read in IndexedDB deserialization
https://bugs.webkit.org/show_bug.cgi?id=308712
Summary Binary key over-read in IndexedDB deserialization
Jarred Sumner
Reported 2026-02-26 00:30:06 PST
I found this via Claude Code Security. Please don't credit me personally. SUMMARY In the binary key deserialization path of decodeKey() at Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp:354, Vector<uint8_t> dataVector(data) copies the entire remaining span into the vector, not just the declared size bytes. For compound array keys, the first binary sub-key's value includes the raw serialized bytes of all subsequent sub-keys. DETAILS At IDBSerialization.cpp:342-358: case SIDBKeyType::Binary: { uint64_t size64; if (!readLittleEndian(data, size64)) return false; if (data.size() < size64) return false; if (size64 > std::numeric_limits<size_t>::max()) return false; size_t size = static_cast<size_t>(size64); Vector<uint8_t> dataVector(data); // BUG: copies ALL remaining bytes skip(data, size); // only advances by size bytes result.setBinaryValue(ThreadSafeDataBuffer::create(WTF::move(dataVector))); return true; } The span cursor is correctly advanced by skip(data, size) for subsequent parsing, but dataVector already contains all trailing serialized data. For compound array keys [binaryKey1, binaryKey2], binaryKey1's value includes the raw serialized form of binaryKey2. Introduced by: https://github.com/WebKit/WebKit/commit/2c844da0386ff67d69fe0982a84ef6df8533571b SUGGESTED FIX Change line 354 from Vector<uint8_t> dataVector(data) to Vector<uint8_t> dataVector(data.first(size)).
Attachments
Radar WebKit Bug Importer
Comment 1 2026-02-26 00:30:12 PST
Anne van Kesteren
Comment 2 2026-03-05 01:14:31 PST
EWS
Comment 3 2026-03-05 05:45:58 PST
Committed 308694@main (a7aa0f525259): <https://commits.webkit.org/308694@main> Reviewed commits have been landed. Closing PR #59965 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.