firefox/neqo: unbounded mem alloc based on unsanitized network input
Categories
(Core :: Networking, defect, P2)
Tracking
()
People
(Reporter: mail, Assigned: kershaw)
References
(Blocks 1 open bug)
Details
(Keywords: csectype-dos, reporter-external, sec-low, Whiteboard: [Fixed in bug 1877942][reporter-external] [client-bounty-form] [verif?][necko-triaged][adv-main124+])
Attachments
(2 files)
|
2.17 KB,
patch
|
Details | Diff | Splinter Review | |
|
196 bytes,
text/plain
|
Details |
Hi there,
This is Max Inden (https://github.com/mxinden).
I believe I found a security vulnerability affecting Firefox.
Summary
A malicious remote server can send a tampered QUIC ACK frame, causing a Firefox instance to attempt an effectively unbounded memory allocation and thus OOM.
Details
When decoding a QUIC ACK frame, Neqo will first read the ACK range count (nr) and then allocate a Vec with a capacity of the count (arr). It does not enforce an upper bound on the count. Thus an attacker can choose an arbitrarily large ACK range count and thus cause Neqo to attempt an effectively infinite memory allocation.
FRAME_TYPE_ACK | FRAME_TYPE_ACK_ECN => {
let la = dv(dec)?;
let ad = dv(dec)?;
let nr = dv(dec)?;
let fa = dv(dec)?;
let mut arr: Vec<AckRange> = Vec::with_capacity(nr as usize);
Next steps
I have attached a patch to this email. You can apply the patch onto latest Neqo main brach via:
git apply 0001-fix-transport-bound-ACK-range-count-in-ACK-frame.patch
I suggest looping in the Neqo maintainers.
- Martin Thomson <mt@lowentropy.net>
- Kershaw <kershaw@mozilla.com>
- Lars Eggert <lars@eggert.org>
I am happy to open a GitHub advisory on the Neqo GitHub repository directly to ease the process.
Hope this is of some help!
Max
Comment 1•2 years ago
|
||
Moving to right component and adding cc's. Thanks!
| Assignee | ||
Comment 2•2 years ago
|
||
Hi Max,
Thanks for filing this bug.
Could you open a github PR for the attached patch?
Thanks.
Could you open a github PR for the attached patch?
Yes, of course. Though wouldn't a GitHub advisory with a private pull request be more appropriate, given that this is security sensitive? I am fine either way.
Updated•2 years ago
|
Comment 4•2 years ago
|
||
A smaller limit sounds good. I will make the adjustment.
Could you open a github PR for the attached patch?
Yes, of course. Though wouldn't a GitHub advisory with a private pull request be more appropriate, given that this is security sensitive? I am fine either way.
It is hard for me to judge what impact an OOM in a Neqo connection has on a running Firefox instance, thus the caution. I am fine with a public pull request. Can you please confirm that a public pull request is preferred, Kershaw? I am sorry for the back-and-forth.
| Assignee | ||
Comment 6•2 years ago
|
||
(In reply to Max Inden from comment #5)
A smaller limit sounds good. I will make the adjustment.
Could you open a github PR for the attached patch?
Yes, of course. Though wouldn't a GitHub advisory with a private pull request be more appropriate, given that this is security sensitive? I am fine either way.
It is hard for me to judge what impact an OOM in a Neqo connection has on a running Firefox instance, thus the caution. I am fine with a public pull request. Can you please confirm that a public pull request is preferred, Kershaw? I am sorry for the back-and-forth.
Let's go with an advisory. Thanks!
I created an advisory and a private pull request with the above suggestions incorporated.
https://github.com/mozilla/neqo/security/advisories/GHSA-5m9j-vr32-g7j5
Updated•2 years ago
|
Updated•2 years ago
|
Comment 8•2 years ago
|
||
We should get this fix into neqo; not high severity due to there being many ways to DOS a browser that can't be blocked. Thanks!
| Assignee | ||
Comment 9•2 years ago
|
||
This bug is tracked here and will be fixed with a new lease of neqo.
| Assignee | ||
Comment 10•2 years ago
|
||
Fixed by bug 1877942.
Thank you, Max!
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 11•2 years ago
|
||
Unfortunately DOS bugs are generally excluded from our bug bounty program
| Reporter | ||
Comment 12•2 years ago
|
||
Unfortunately DOS bugs are generally excluded from our bug bounty program
Totally fine! Thank you for all the help getting this into Firefox.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 13•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•