-
Notifications
You must be signed in to change notification settings - Fork 21
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
π‘οΈ Inadequate Input Validation in Objectarium Contract Instantiation #560
Comments
π AnalysisThe current In addition to this, we leverage the implicit validation provided by
We also utilize JSON and π Suggested ImprovementThe default For the
While these checks are not mandatory for the integrity and security of the chain, they could help users avoid misconfiguration of For |
@bdeneux Are you sure about the 0 considered as no limit? Here are all the possible checks I identified, let's discuss on them and converge to a consensus π
|
@amimart Sorry, you're right, according to the documentation it's not the zero value that indicate no limit but omitted value.
|
/// The acceptable compression algorithms for the objects in the bucket. | |
/// If this parameter is not set (none or empty array), then all compression algorithms are accepted. | |
/// If this parameter is set, then only the compression algorithms in the array are accepted. | |
/// | |
/// When an object is stored in the bucket without a specified compression algorithm, the first | |
/// algorithm in the array is used. Therefore, the order of the algorithms in the array is significant. | |
/// Typically, the most efficient compression algorithm, such as the NoCompression algorithm, should | |
/// be placed first in the array. | |
/// | |
/// Any attempt to store an object using a different compression algorithm than the ones specified | |
/// here will fail. | |
#[serde(default = "CompressionAlgorithm::values")] | |
pub accepted_compression_algorithms: Vec<CompressionAlgorithm>, |
BucketLimits
β
Ok for those configurations checks. For the max_objects_pins
, there is no interest being set to 0 but it's possible, I don't know too what is the best option π€·.
Note
Severity: Low
target: v5.0.0 - Commit: cde785fbd2dad71608d53f8524e0ef8c8f8178af
Ref: OKP4 CosmWasm Audit Report v1.0 - 02-05-2024 - BlockApex
Description
The instantiation process in the Objectarium contract lacks comprehensive input validation, specifically for the parameters associated with bucket configuration and limits. This deficiency may lead to configurations that render the contract functionally ineffective or vulnerable to misuse. The
try_new
method in the Bucket class currently only checks for an empty bucket name, overlooking critical validations on the numerical limits set for the bucket.Recommendation
Enhance the validation logic within the
Bucket::try_new
method to include checks on all parameters.The text was updated successfully, but these errors were encountered: