fix: identity attribute bypass, REST panic recovery, etcd key injection, MongoDB watch idle, and more#44
Merged
Merged
Conversation
…uard, etcd key injection, MongoDB watch idle, Discover error handling, asserter body limit, errors.Unwrap, discover serviceName validation
H1: Re-assert request_user/request_groups/request_entity after user-attribute
merge to prevent authorization bypass via injected identity attributes.
H3: Add HTTPPanicRecoveryMiddleware to both REST routers (was gRPC-only).
Add nil guard to IsSubSet to prevent reflect.TypeOf(nil).Kind() panic.
H6: Add validateID for policy/rolePolicy IDs; add validateServiceName to all
missing etcd read/list/delete methods. Prevents etcd key injection via
crafted IDs containing '/' (e.g. '../../functions/victim').
C1: MongoDB watch no longer exits on idle timeout — distinguishes deadline
expiry (retry) from genuine stream error (exit). Fixes broken incremental
cache updates after 30s of no policy changes.
C3: REST Discover handler now returns HTTP error on evaluation failure
instead of HTTP 200 with allowed:true.
M1: Validate serviceName in etcd discover PutRequest/Get*/Reset* methods.
L2: Add 1MB body limit to asserter webhook response (was unbounded).
Q1: Add Unwrap() to speedleError for stdlib errors.Is/As compatibility.
Co-Authored-By: Claude <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Round 4 Hardening — Security & Correctness
Fixes from the latest 3-agent review sweep:
High
request_user/request_groups/request_entitynow re-asserted after user-attribute merge (was only resource/action/time). Prevents auth bypass viaAttributes:{"request_user":"admin"}.HTTPPanicRecoveryMiddlewareto both REST routers (was gRPC-only). Plus nil guard inIsSubSetto preventreflect.TypeOf(nil).Kind()panic.validateIDfor policy/rolePolicy IDs +validateServiceNameon all missing read/list/delete methods. Preventsid="../../functions/victim"traversal.Medium
changeStream.Next()returning false on deadline expiry now retries instead of exiting. Was breaking incremental cache updates after 30s idle.allowed:true.Low / Quality
speedleError.Unwrap()added for stdliberrors.Is/errors.Ascompatibility.🤖 Generated with Claude Code