Skip to content
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

Fix blob upload verify hash bypass #87

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

Dramelac
Copy link
Contributor

@Dramelac Dramelac commented Jan 3, 2025

Currently the verifyHash is checked if the string is not empty but in some cases, undefined is supplied to the function to bypass the hash verification but !undefined === true so an error is raise.
This PR change the check to explicitly detect the undefined value and continue the execution.

This change fix the issue #86:

[wrangler:inf] DELETE /v2/image-b/blobs/uploads/7b51c49f-58c2-4864-8d86-ba5014f5333a 204 No Content (43ms)

This PR also remove the temporary upload file from the R2 bucket after the upload abort.

@Dramelac Dramelac changed the title Fix empty string detection + undefined bypass Fix blob upload verify hash bypass Jan 3, 2025
@gabivlj gabivlj merged commit d41961c into cloudflare:main Jan 3, 2025
3 checks passed
east4ming pushed a commit to east4ming/serverless-registry that referenced this pull request Jan 11, 2025
* Fix empty string detection + undefined bypass

* Delete upload file from R2 after cancel
east4ming pushed a commit to east4ming/serverless-registry that referenced this pull request Jan 11, 2025
* Fix empty string detection + undefined bypass

* Delete upload file from R2 after cancel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants