Skip to content

guardcore: policy.json signature check fails open on any verification error or missing signature #104

Open

Description

@codeyevsky

Problem

In packages/guard/guardcore/config.go:56, the condition that decides whether a loaded policy.json is trusted treats a verification error (or an absent signature) as equivalent to "no verification required" rather than "untrusted", so the file is loaded and applied either way.

Impact

An attacker who can write to the policy file location (or strip/corrupt its signature) can have an invalid or completely unsigned policy accepted and enforced, silently disabling whatever protections the signature check was meant to guarantee. This is a fail-open pattern in a security-critical trust boundary.

Repro

  1. Start from a valid, signed policy.json.
  2. Corrupt the signature bytes (or delete the signature field) without touching the policy body.
  3. Reload guardcore's config and observe the corrupted/unsigned policy is still loaded and enforced instead of being rejected.

Suggested fix

Invert the control flow so any verification failure (parse error, signature mismatch, missing signature when one is expected) causes the loader to reject the file and fall back to the last known-good policy or a safe default, logging the failure. Only a positive, successful verification result should allow the loaded policy to be applied.

Activity

  1. sharmis-tp commented on Nov 18, 2026

    @sharmis-tp

    A signature check that fails open is worse than no check at all — it gives the appearance of security while providing none. I'll make every verification error a hard failure with a specific error message, and add tests for corrupted signatures, wrong keys, and missing signatures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions