regression: negative Content-Length check lost in v2.0.0 rewrite #4
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: SheWhoReignsSupreme/forge-paste#4
Loading…
Add table
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?
Summary
The v2.0.0 rewrite of
forge-paste.pyre-introduced the negativeContent-Lengthvulnerability that was fixed in the previous version (issue #2 / PR #3).Vulnerable Code
A client sending
Content-Length: -1bypasses the> MAX_SIZEcheck and callsrfile.read(-1), which reads until EOF — hanging the server thread indefinitely and potentially causing a denial-of-service.Fix
Add a
length < 0guard (same fix as the previous version had):Context
This was previously fixed in PR #3 but was lost when v2.0.0 was written as a single-commit full rewrite. The TTL/expiry fix from #3 was correctly carried over — this specific guard was missed.