Repository navigation
api: raise batch request-target guard to 16 KiB #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d0db1a3
8d13926
949f4be
7ad8bba
b1720af
e1e25f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| '@hypercerts-org/happyview-modules': patch | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bump the bundle to
Suggested fix
|
||
| '@hypercerts-org/api': patch | ||
| --- | ||
|
|
||
| Batch queries now accept 100 typical record links in one request. | ||
|
|
||
| The limit on the encoded request URL path and query for `getFollows`, `getEntityFollows`, `getFollowerCounts` and `getCommentCounts` rises from 7,000 to 16,384 bytes. `getReactionCounts` and `getActorReactions` now enforce the same limit. Requests over the limit are still rejected with an `InvalidRequest` message, returned as HTTP 500 by the current HappyView release. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Measure the received request-target, or document the limit as canonical encoding.
The guard in
batchRequestTarget.luaestimates the target length from the decoded values. It counts unreserved ASCII as one byte and every other byte as three. A client can percent-encode unreserved characters, for example%61fora. That form is longer on the wire than the guard counts. A request can then exceed the documented 16,384-byte encoded request-target limit and still pass the guard. The guard cannot detect this because it never reads the raw target. A separate wire-size limit in the HTTP layer may reject such a request first, but this repository does not show one.Choose one correction:
openapi.jsonand the matching Lexicon descriptions.The current descriptions promise a wire limit that the guard does not enforce.
Checkov (3.3.30)
[high] 1-6243: Ensure that the global security field has rules defined
(CKV_OPENAPI_4)
[high] 1-6243: Ensure that security operations is not empty.
(CKV_OPENAPI_5)