Memory disclosure vulnerability in ContentParent::RecvGetIconForExtension
A parent-process IPC handler allocated a heap buffer without initialising it, then passed it to a helper that only filled it when the requested length matched the buffer size. When the lengths differed, the uninitialised buffer was returned to the untrusted child process, letting a compromised child read leftover parent-process memory.
Originally disclosed on Mozilla
- Fixed in 41 days
- Paid in 47 days
- Disclosed after 41 days
Vulnerability Logic:
1. RecvGetIconForExtension allocates a buffer `bits` using `bits->AppendElements(size)`.
2. For `uint8_t`, `AppendElements` does not zero-initialize the memory; it simply allocates the space on the heap.
3. This buffer is passed to `AndroidBridge::Bridge()->GetIconForExtension`.
4. Inside `GetIconForExtension`, there is a size check: `if (len == bufSize) memcpy(...)`.
5. If `len != bufSize`, the `memcpy` is skipped entirely.
6. The function returns `IPC_OK()` without modifying the `bits` buffer further.
7. Result: The `bits` array, containing raw uninitialized memory from the Parent process heap, is sent back to the untrusted Child process.
Impact:
A compromised child process could trigger this path to read uninitialized memory from the parent process (Sandbox Escape / Information Disclosure).
Suggested Fix:
1. Ensure the buffer is zero-initialized upon allocation (e.g., use `AppendElements` with a value or `SetLength` + `memset`).
2. Or, ensure `RecvGetIconForExtension` returns an error if `GetIconForExtension` fails to populate the buffer.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the buffer was allocated without zero-initialisation and the handler returned success even when the helper skipped writing to it because the requested length did not match the buffer size.
Impact
A compromised child process could read uninitialised parent-process memory, which the text frames as an information disclosure and possible sandbox escape.
What the attacker needed
Compromised child process; ability to send IPC requests
The fix
The buffer should be zero-initialised on allocation, or the handler should return an error when the helper fails to populate it.
How it was found
- The child process sends an IPC request to RecvGetIconForExtension.
- The parent allocates the bits buffer without zeroing it.
- The buffer is passed to GetIconForExtension.
- If the requested length differs from the buffer size, the copy is skipped.
- The handler returns success with the buffer unmodified.
- The uninitialised buffer is sent back to the child.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A program can ask another, more privileged part of the browser for an icon. The privileged part reserved some memory for the answer but never cleared it, and in one case never wrote the icon into it either. It then handed that memory back, so the less trusted part could see whatever was left there before, which might be sensitive data.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.