You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit df8b432
Browse filesBrowse the repository at this point in the historyBrowse files
fix(notifications): drain the response instead of capping it
A 2xx with a body past the cap rejected the delivery promise, so the dispatcher
recorded a notification the receiver had accepted as FAILED and the outbox
retried it. The response is now taken as a stream and drained for at most 8 KiB
before the socket is dropped, which keeps the heap flat without ever letting a
response decide whether a delivery succeeded.
Copy file name to clipboardExpand all lines: .changeset/notification-response-size-cap.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,8 @@
2
2
'nostream': patch
3
3
---
4
4
5
-
fix(notifications): cap the response a notification delivery will read
5
+
fix(notifications): never buffer the response a notification delivery gets back
6
6
7
-
A delivery is a POST whose only interesting part is the status code, but axios advertised every encoding it can decode, decompressed whatever a receiver sent back, and buffered the whole result while nothing read it. A receiver answering with a small gzip body that decodes to hundreds of megabytes therefore spent the delivery worker's heap for a value nobody consumed (security issue #1257).
7
+
A delivery is a POST whose only interesting part is the status code, but axios advertised every encoding it can decode, decompressed whatever a receiver sent back and buffered the whole result while nothing read it. A receiver answering with a small gzip body that decodes to hundreds of megabytes therefore spent the delivery worker's heap for a value nobody consumed (security issue #1257).
8
8
9
-
Delivery requests now carry `accept-encoding: identity`, `decompress: false`, an empty transform list so the body is never parsed, and a 64 KiB `maxContentLength` that aborts a response as soon as it runs past it. The request side stays unbounded on purpose: a `settings.changed` envelope carries the changed values, so a blacklist edit alone can produce a body past any small cap, and capping it would drop deliveries that work today.
10
-
11
-
The empty transform list also closes a second bug: a receiver that compressed unsolicited used to fail the delivery at `JSON.parse` even though it had answered 2xx.
9
+
Deliveries now ask for `accept-encoding: identity`, take the response as a stream so no body is buffered or parsed at all, and drain at most 8 KiB of it before dropping the socket. Success is the status and only the status: no response size can turn a notification the receiver accepted into a `FAILED` row the outbox then retries. The request side stays unbounded on purpose, because a `settings.changed` envelope carries the changed values and a blacklist edit alone can produce a body past any small cap.
0 commit comments