-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(security): CVE-2024-43783: Enforce body limits early in request p…
…ipeline This fixes a weakness (classified as [CWE-770]) which made it possible to exceed the configured request payload maximums set with the [`limits.http_max_request_bytes`] configuration option when used in conjunction with certain configurations. Review the Github Advisory, [GHSA-x6xq-whh3-gg32], for specific details and impacted configurations. After the fix: - Request body payload limits are now enforced earlier in the pipeline, ensuring that coprocessors and user plugins respect the configured limit. - Reading a request body beyond the configured limit will abort the request and return a [HTTP 413] (Content Too Large) response to the client rather than delgating to the code consuming the body. To use different limits, `limits.http_max_request_bytes` must be configured to the desired value. - Coprocessors, Rhai and Rust plugins do NOT have an opportunity to intercept aborted requests. Use the telemetry features of the router to observe HTTP 413 events. [CWE-770]: https://cwe.mitre.org/data/definitions/770.html [GHSA-x6xq-whh3-gg32]: GHSA-x6xq-whh3-gg32 [HTTP 413]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413 [`limits.http_max_request_bytes`]: https://www.apollographql.com/docs/router/configuration/overview/#http_max_request_bytes --------- Co-authored-by: bryn <bryn@apollographql.com> Co-authored-by: Gary Pennington <gary@apollographql.com> Co-authored-by: Jeremy Lempereur <jeremy.lempereur@iomentum.com>
- Loading branch information
Showing
25 changed files
with
1,591 additions
and
437 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
### Payload limits may exceed configured maximum ([Issue #ISSUE_NUMBER](https://github.com/apollographql/router/issues/ISSUE_NUMBER)) | ||
|
||
When processing requests the configured limits as defined in the `limits` section may be ignored: | ||
```yaml | ||
limits: | ||
http_max_request_bytes: 2000000 | ||
``` | ||
Plugins that execute services during the `router` lifecycle will not respect the configured limits. Potentially leading to a denial of service attack vector. | ||
|
||
#### Built features affected: | ||
* Coprocessors configured to send the entire body of a request are vulnerable to this issue: | ||
```yaml | ||
coprocessor: | ||
url: http://localhost:8080 | ||
router: | ||
request: | ||
body: true | ||
``` | ||
|
||
#### Fix details | ||
Body size limits are now moved to earlier in the pipeline to ensure that coprocessors and user plugins respect | ||
the configured limits. | ||
Reading a request body past the configured limit will now abort the request and return a 413 response | ||
to the client instead of delegating to the code reading the body to handle the error. | ||
|
||
#### User impact | ||
Body size limits are now enforced for all requests in the main graphql router pipeline. Custom plugins are covered by | ||
this and any attempt to read the body past the configured limit will abort the request and return a 413 response to the client. | ||
|
||
Coprocessors, rhai and native plugins do not have an opportunity to intercept aborted requests. It is advised to use | ||
the telemetry features within the router if you need to track these events. | ||
|
||
By [@bryncooke](https://github.com/AUTHOR) in https://github.com/apollographql/router/pull/PULL_NUMBER |
This file contains 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
This file contains 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
Oops, something went wrong.