Skip to content

WithTimeoutGraceful fails open (induced latency = guardrail bypass) #103

Description

@MitulShah1

Priority: P3 · Nature: insecure default

Problem

guardrail/async.go:82-124 WithTimeoutGraceful returns a passing result on timeout:

case <-ctx.Done():
    return &Result{Passed: true, TripwireTriggered: false, ...}, nil

Impact

Wrapped around a network-backed guardrail (e.g. moderation.NewOpenAI), an attacker who induces latency (large payload, slow provider) bypasses the check — an availability problem becomes a security bypass.

Fix

Fail closed by default for security-classified guardrails, or make the choice explicit and clearly named (WithTimeoutFailOpen vs WithTimeoutFailClosed).


Filed from a full-repo audit (branch main). Verified against source; baseline go vet/staticcheck/go test -race pass on the default build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-lowHardening / cleanuparea/guardrailbugSomething isn't workingsecuritySecurity vulnerability or claim gap

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions