You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We reviewed changes in b4c0308...c279b6b on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Two of the security issues come from how paths are constructed, leading to traversal and arbitrary deletion risks.
Given how careful the upload lifecycle is, it’s worth holding path joining to the same standard so the integrity guarantees apply both to where data lives and how it’s reached.
Receiver semantics vs. abstraction cleanliness
The mixed pointer/value receivers and the Delete “warning only” behavior both create subtle differences in how storage backends behave.
Your abstraction is nicely disciplined; aligning method semantics (receivers and delete behavior) will help keep that contract predictable across implementations.
The reason will be displayed to describe this comment to others. Learn more.
Type "FileSystemStore" has both value and pointer receivers
(Go's FAQ)[https://go.dev/doc/faq#methods_on_values_or_pointers] recommends
that method receivers should be consistent. If some of the methods of the type
must have pointer receivers, the rest should too, so the method set is
consistent regardless of how the type is used. This is because value and
pointer receivers have different method sets.
The reason will be displayed to describe this comment to others. Learn more.
Type "FileSystemStore" has both value and pointer receivers
(Go's FAQ)[https://go.dev/doc/faq#methods_on_values_or_pointers] recommends
that method receivers should be consistent. If some of the methods of the type
must have pointer receivers, the rest should too, so the method set is
consistent regardless of how the type is used. This is because value and
pointer receivers have different method sets.
Unvalidated srcPath/dstPath can resolve outside c.basePath. If any caller passes attacker-influenced values, arbitrary file relocation or overwrite becomes possible.
Use filepath.Clean, reject absolute and .. segments, then verify resolved paths keep the c.basePath prefix before renaming
filePath is not normalized or constrained to the blob root before deletion. A crafted traversal path could delete unintended host files when upstream validation is bypassed.
Use filepath.Clean, reject absolute/.. paths, and ensure the resolved target remains under c.basePath before deletion
Move logs srcObj.Delete errors but still returns success. That breaks move semantics and can leave both source and destination objects present, causing stale temporary blobs and inconsistent state for downstream workflows.
Return a wrapped error when srcObj.Delete fails, or implement compensating rollback by deleting dstObj before returning an error
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
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.
No description provided.