Skip to main content
Founding Partner + 7-Day Trial
Tier B Enterprise Fleet · 12-Language Immunity EngineAutoExtinguish: true (4-Gate Vericoding)

AutoExtinguish: true — synthesizes length-safe constant-time comparison primitives and verifies compilation + tests in the 4-Gate sandbox.

Commercial boundary: ciphermap immunity scan, immunity extinguish --apply, immunity attest (CycloneDX 1.6 CISA IBOM & OpenVEX 0.2.0), and ciphermap mcp require Tier B Enterprise Fleet. Offline proof and IBOM verification (--verify-proof, attest --verify) and the ciphermap demo sandbox run Free.

Back to docs
IMM-TIMING-001HIGHCISA Secure-by-Design Pledge · CWE-208 · NIST SP 800-53 Rev. 5 (SC-13)

Non-Constant-Time Secret, HMAC, or Webhook Signature Comparison

Severity: HIGH

Standard string and byte-slice equality operators short-circuit on the first mismatched byte, creating an observable statistical timing side-channel over network or local IPC boundaries when validating webhook signatures, HMAC digests, or API tokens. CipherMap IMM-TIMING-001 traces cryptographic digest and secret identifiers across all 12 supported languages and synthesizes constant-time equality replacements verified inside the 4-Gate OS sandbox.

Remediation checklist

  • Go: replace == / bytes.Equal on digests and secrets with crypto/hmac.Equal or crypto/subtle.ConstantTimeCompare; Python: replace == with hmac.compare_digest.
  • TypeScript & JavaScript: verify buffer byte lengths match first, then compare with node:crypto.timingSafeEqual; Java & Kotlin: use MessageDigest.isEqual on raw digest bytes.
  • C#: use CryptographicOperations.FixedTimeEquals; Rust: use subtle::ConstantTimeEq; Ruby: ActiveSupport::SecurityUtils.secure_compare; PHP: hash_equals.

Illustrative Code Examples

These fragments explain migration direction. They are not complete applications or compiler-verified patches for your project.

Vulnerable — short-circuiting string equality on webhook HMAC digest

terminal · zsh
// Go: leaks prefix match length via early-exit string comparison
expected := hex.EncodeToString(mac.Sum(nil))
if signatureHeader == expected {
  processWebhook(payload)
}

Remediated — constant-time comparison (4-Gate verified)

terminal · zsh
// Go: constant-time comparison over decoded or byte digests
expected := hex.EncodeToString(mac.Sum(nil))
if subtle.ConstantTimeCompare([]byte(signatureHeader), []byte(expected)) == 1 {
  processWebhook(payload)
}

Scan your own repository for IMM-TIMING-001 locally (0 code egress)

Preview proposed changes free with ciphermap fix . --dry-run --offline --no-telemetry. Eligibility depends on the installed build, call shape, module format, and migration context. The bundled RSA fixture has a classical key-size candidate; that does not make it post-quantum secure. Persisted digests and unsupported contexts may be declined. Applying supported candidates requires an entitlement, explicit verifier consent, and the required project tools. Review the actual verification result before adopting a change.

Other rule families