Repository navigation
fix: bound push responses and reject interrupted streams - #998
Open
yotatameguchi-boop wants to merge 2 commits into
Open
yotatameguchi-boop wants to merge 2 commits into
yotatameguchi-boop wants to merge 2 commits into
Conversation
…ation Responses over 64 KiB now reject instead of being buffered without limit. Add a Security considerations section to the README covering endpoint validation (SSRF) and the timeout option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A push service can send an arbitrarily large response or terminate a response before its advertised body is complete. Previously,
sendNotification()buffered the entire body without a limit and listened for errors only on the request. A truncated response emits an error on the response stream, leaving the notification promise pending even when a socket timeout was configured.This change caps buffered responses at 64 KiB, destroys oversized requests, and rejects notification promises on response stream errors. The README documents the response limit and transport errors, plus endpoint validation and socket timeout considerations for applications accepting untrusted subscriptions.
Endpoint allowlisting remains an application responsibility. There is no default timeout or total request deadline; a socket timeout bounds inactivity rather than total response time. The 64 KiB limit intentionally changes handling of unusually large service responses.
Validation on Node.js 24.18.1:
npm run lint: passed.npx mocha --ui tdd 'test/test-*.js' test/testSetGCMAPIKey.js test/testSendNotification.js: 137 passing.git diff --check: passed.All network regression tests use a local HTTPS fixture. Browser integration tests were not run locally.