Repository navigation
fix(workflowengine): prevent unknown upload sizes from matching as zero and add test coverage - #66509
Open
joshtrichards wants to merge 3 commits into
Open
joshtrichards wants to merge 3 commits into
joshtrichards wants to merge 3 commits into
Conversation
Allow the cached file size to be `false` when no valid size header is available. Previously, assigning `false` to the numeric property coerced it to zero, causing some size checks to match unexpectedly. Preserving `false` lets the existing guard reject the check instead of comparing an unknown size as zero. Signed-off-by: Josh <josh.t.richards@gmail.com>
Add regression coverage ensuring missing or invalid size headers do not match any size operator, including when the unknown result is cached. Cover valid zero-byte sizes, threshold equality, header precedence, POST/PUT Content-Length fallback, and cached-result reuse. Assisted-by: Copilot:gpt-6.1-sol Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
joshtrichards
force-pushed
the
jtr/fix-flow-filesize-unknown
branch
from
November 11, 2026 14:53
0e4396f to
e0c2c5d
Compare
2 of 4 tasks
Member
Author
|
/backport to stable35 |
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Discovered by working on nextcloud/files_accesscontrol#1259 and nextcloud/documentation#16036.
In the current implementation, a missing or invalid size header is inadvertently treated as zero -- potentially causing unintended rule matches. Consequently, a
lessorless or equalsrule may match requests without a size header, including requests that are not uploads. This happens because assigningfalseto the numeric$sizeproperty gets silently coerces to0(no error becausestrict_typesisn't yet active in this part of the code base).Changes:
falsein the property type so the existing guard returns “no match” for unknown sizes (as intended; that code/check is pre-existing).TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)