You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
guardcore: policy.json signature check fails open on any verification error or missing signature #104
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
Start from a valid, signed policy.json.
Corrupt the signature bytes (or delete the signature field) without touching the policy body.
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.
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.
Activity
sharmis-tp commentedon Nov 18, 2026
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.