File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -336,14 +336,18 @@ impl SharedIpAccessControl {
336336 /// Check if an IP address is allowed (blocking version).
337337 ///
338338 /// This is useful when you need to check access in a synchronous context.
339+ /// On lock contention, defaults to DENY for security (fail-closed).
339340 pub fn check_sync ( & self , ip : & IpAddr ) -> AccessPolicy {
340341 // Try to acquire read lock without blocking
341342 if let Ok ( guard) = self . inner . try_read ( ) {
342343 return guard. check ( ip) ;
343344 }
344- // If lock is contended, default to allow to avoid blocking
345- tracing:: warn!( "Access control lock contended, defaulting to allow" ) ;
346- AccessPolicy :: Allow
345+ // Fail-closed: deny on lock contention to prevent security bypass
346+ tracing:: warn!(
347+ ip = %ip,
348+ "Access control lock contended, denying for security"
349+ ) ;
350+ AccessPolicy :: Deny
347351 }
348352
349353 /// Block an IP address at runtime.
You can’t perform that action at this time.
0 commit comments