An encrypted push message with rs=0 can freeze the parent process (DoS)
Categories
(Core :: DOM: Push Subscriptions, defect, P2)
Tracking
()
People
(Reporter: saschanaz, Assigned: saschanaz)
References
(Blocks 1 open bug)
Details
(Keywords: csectype-dos, sec-low, Whiteboard: [adv-main132+] [adv-esr128.4+])
Attachments
(5 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr128+
|
Details | Review |
|
219 bytes,
text/plain
|
Details |
function getCryptoParamsFromPayload(payload) {
if (payload.byteLength < 21) {
throw new CryptoError("Truncated header", BAD_CRYPTO);
}
let rs =
(payload[16] << 24) |
(payload[17] << 16) |
(payload[18] << 8) |
payload[19];
if rs becomes 0, it means each record has size of 0. Here we iterate the buffer based on that size, resulting an infinite loop.
The implication here is that a remote server can send a push message with those bytes being 0, which then freezes the subscriber's user agent when it receives the message (which can happen in random time, as it's a push message).
Updated•1 year ago
|
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Does this code run in the parent process or a content process? The latter sounds less bad.
| Assignee | ||
Comment 2•1 year ago
|
||
PushCrypto runs on the parent process as PushService runs on it.
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
| Assignee | ||
Comment 4•1 year ago
|
||
| Assignee | ||
Comment 5•1 year ago
|
||
Comment on attachment 9431075 [details]
Bug 1924154 - Disallow too small record r=asuth
Security Approval Request
- How easily could an exploit be constructed based on the patch?: (No sec triage yet, but feel free to discard if not needed)
One would have to understand what record size can do in aes128gcm decryption and what 0 can mean there. (The patch disallows any number below 18 and also touched aesgcm which I believe is not affected, but should help for not-drawing bulls-eye)
- Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: No
- Which branches (beta, release, and/or ESR) are affected by this flaw, and do the release status flags reflect this affected/unaffected state correctly?: all branches
- If not all supported branches, which bug introduced the flaw?: None
- Do you have backports for the affected branches?: Yes
- If not, how different, hard to create, and risky will they be?:
- How likely is this patch to cause regressions; how much testing does it need?: Shouldn't cause regression; any other incorrect rs value causes decode failure anyway.
- Is the patch ready to land after security approval is given?: Yes
- Is Android affected?: Yes
Comment 6•1 year ago
|
||
This would be a nasty mean trick to pull on people, and probably hard for people to figure out where it's coming from, but it's still hard to rate it much higher "low" given you'd also have to convince people to accept your notifications.
Comment 8•1 year ago
|
||
| Assignee | ||
Comment 9•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D225687
Updated•1 year ago
|
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Comment on attachment 9431075 [details]
Bug 1924154 - Disallow too small record r=asuth
This is sec-low (rated after the approval was requested, so thank you), so no approval is needed.
Comment 11•1 year ago
|
||
beta Uplift Approval Request
- User impact if declined: An evil remote server can freeze push notification subscribers using Firefox anytime.
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: None
- Risk associated with taking this patch: low
- Explanation of risk level: Explicitly banning invalid values; those (other than 0) already throws a (more vague) error already
- String changes made/needed: None
- Is Android affected?: no
| Assignee | ||
Comment 12•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D225687
Updated•1 year ago
|
Comment 13•1 year ago
|
||
esr128 Uplift Approval Request
- User impact if declined: An evil remote server can freeze push notification subscribers using Firefox anytime.
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: None
- Risk associated with taking this patch: low
- Explanation of risk level: Explicitly banning invalid values; those (other than 0) already throws a (more vague) error already
- String changes made/needed: None
- Is Android affected?: no
Updated•1 year ago
|
Updated•1 year ago
|
Comment 14•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 15•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 16•1 year ago
|
||
Updated•1 year ago
|
Comment 17•1 year ago
|
||
Comment 18•1 year ago
|
||
Comment 19•1 year ago
|
||
Updated•1 year ago
|
Description
•