fix: hscan count limit - #337
Conversation
|
Claude finished @xDarksome's task in 1m 48s —— View job Code Review CompleteReviewed PR #337: fix: hscan count limit Issues FoundIssue 1: Missing descriptive error message if op.count > MAX_HSCAN_COUNT {
return Error::invalid_argument();
}Recommendation: Add descriptive message to help clients debug: if op.count > MAX_HSCAN_COUNT {
return Error::invalid_argument()
.with_message(format!("HSCAN count {} exceeds maximum limit of {}", op.count, MAX_HSCAN_COUNT));
}Issue 2: No test coverage Recommendation: Add tests covering:
Issue 3: Undocumented magic number const MAX_HSCAN_COUNT: u32 = 5000;Problem: No documentation explaining rationale for 5000 Recommendation: Add doc comment explaining choice: /// Maximum allowed count for HSCAN operations to prevent unbounded memory allocation.
/// This limit prevents clients from requesting excessively large result sets that could
/// cause memory exhaustion on the server.
const MAX_HSCAN_COUNT: u32 = 5000;Issue 4: Potential boundary clarification Question: Validation uses Security Assessment✅ Fix correctly addresses unbounded client-controlled input vulnerability |
564fa41 to
b084b65
Compare
Description
Resolves https://linear.app/reown/issue/WCN2-188/h-02-unbounded-client-controlled-hscan-count-drives-a-vecwith
How Has This Been Tested?
Not tested
Due Diligence