[quality] add 35 tests for read-capped-body DoS prevention modules (CWE-400)#19756
[quality] add 35 tests for read-capped-body DoS prevention modules (CWE-400)#19756kubestellar-hive[bot] wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
c696ac7 to
63cfc57
Compare
…WE-400) Adds comprehensive tests for two previously untested security-critical modules that enforce request body size limits: - read-capped-body.ts (24 tests): content-length early rejection, streaming byte enforcement, multi-chunk handling, edge cases - readCappedBody.ts (11 tests): stream-only enforcement, BodyTooLargeError, Content-Length header distrust, multibyte character handling Signed-off-by: Quality Agent <quality-agent@kubestellar.io>
63cfc57 to
645c245
Compare
Test Improvement
Adds 35 tests for two security-critical DoS prevention modules at 0% coverage:
read-capped-body.ts (24 tests)
isBodyTooLargeError: Error type detectionreadCappedBodyBuffer: null body, within limit, at boundary, content-length rejection, streaming rejection, multi-chunk, edge casesreadCappedBodyText: text decoding, UTF-8 multibytereadCappedBodyJson: parse valid/invalid, size enforcementreadCappedBody.ts (11 tests)
BodyTooLargeErrorclass constructionBoth modules mitigate CWE-400 (Uncontrolled Resource Consumption).
Filed by quality agent (hold-gated mode). Human review required.