Limit read of well-known files #1
Labels
No labels
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Blocks
#1505 Rewrite resolver service
continuwuation/continuwuity
Reference
continuwuation/resolvematrix#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CWE-409 or similar
with "limit read" here do you mean like limit how much data is read?
@s1lv3r wrote in #1 (comment):
I think so, to avoid e.g. zip bombs
Something similar to spider size for URL previews could be used I guess?
or set a hardcoded max of like 1MB, no reasonable well-known file will ever be above that size
It's just an option that needs to be passed to reqwest iirc, not too hard to do.
Looked into it, would have to be done using either:
Response::content_length(): Not always knownVec, counting the total (as described in https://github.com/seanmonstar/reqwest/issues/848)Probably the easiest to do the former, and fall back to the latter if the former fails. Will start an implementation.
@s1lv3r wrote in #1 (comment):
One of the reasons this isnt known is
Given the CWE this is trying to avoid is with GZIP/compressed content, I would say that way is not helpful really.
Anyways, I thought jade said it was just one param
I thought so too, doesn't look like it from what I could find
It's already done in Continuwuity, I was just going to copy from there
oh
good idea, might as well yeah
@Jade wrote in #1 (comment):
Relevant file: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/src/core/utils/response.rs