Awesome Reviewers

Reviewer · Security

Complete security control coverage

Security-sensitive logic must be applied consistently and completely across every relevant code path, state, and capability—partial or path-dependent enforcement creates exploitable gaps.

Instruction

Security-sensitive logic must be applied consistently and completely across every relevant code path, state, and capability—partial or path-dependent enforcement creates exploitable gaps.

  • Timing consistency: Authentication logic that does expensive work (e.g., password hashing) to prevent timing attacks must perform the same work on every path, including both “user exists” and “user does not exist” branches. If a dummy hash is computed only in one branch, an attacker can enumerate valid usernames by measuring response time. Example: the login handler must always call bcrypt.GenerateFromPassword with real work, regardless of whether the account was found, so total request time is attacker-indistinguishable.

  • Security state transitions: When disabling or restricting a feature based on sensitive state changes (e.g., disabling CORS when Vault is sealed), make sure the logic is triggered from the single authoritative code path that covers all ways the state can be reached (manual seal, automatic seal due to error, HA failover, replication state changes, etc.), rather than one specific call site. Trace every caller of the state-changing function (e.g., sealInternalWithOptions, preSeal) to confirm the security behavior can’t be bypassed by an alternate route.

  • Authorization completeness: When defining or granting capabilities/permissions (ACL policies, scopes, roles), explicitly enumerate every distinct capability needed instead of assuming a broader capability implies it. For example, "patch" is a separate capability from "update" in Vault ACL policies—a CRUD policy intended to grant full access must list it explicitly:

    path "secret/*" {
    capabilities = ["create", "read", "update", "patch", "delete"]
    }
    

When reviewing security-related changes, explicitly ask: “Does this behavior hold for every code path that can reach this state?” and “Are all required capabilities/permissions enumerated, not just the common ones?” Add tests that exercise the alternate/error paths to verify the security guarantee holds uniformly.