Opt-in rule (--rule IMM-REDIR-001 or CIPHERMAP_EXPERIMENTAL_REDIR=1) · AutoExtinguish: true.
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.
Unvalidated Open Redirect from Raw HTTP Parameter
Severity: MEDIUM
Passing raw query parameters (next, returnTo, redirect_uri, continue) directly into http.Redirect, res.redirect, or RedirectResponse allows attackers to craft phishing and OAuth token-leakage links using external origins or protocol-relative '//evil.example' and '/\evil.example' paths. IMM-REDIR-001 is available via --rule IMM-REDIR-001 or CIPHERMAP_EXPERIMENTAL_REDIR=1 and synthesizes strict relative-path guards.
Remediation checklist
- Restrict post-login returnTo/next redirect targets to relative paths beginning with a single '/' while explicitly rejecting '//' and '/\' authority prefixes.
- When cross-subdomain redirects are required, parse the URL and match hostname + scheme against a strict static allowlist.
- Run targeted audits during auth flows with ciphermap immunity scan . --rule IMM-REDIR-001 --offline.
Illustrative Code Examples
These fragments explain migration direction. They are not complete applications or compiler-verified patches for your project.
Vulnerable — raw query parameter passed into HTTP redirect
// Go: '//evil.example' redirects victim off-origin
http.Redirect(w, r, r.URL.Query().Get("next"), http.StatusFound)Remediated — strict single-slash relative path guard
// Go: enforces local relative path and blocks '//' & '/\' bypasses
next := r.URL.Query().Get("next")
if !strings.HasPrefix(next, "/") || strings.HasPrefix(next, "//") || strings.Contains(next, "\\") {
next = "/dashboard"
}
http.Redirect(w, r, next, http.StatusFound)Scan your own repository for IMM-REDIR-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
Quantum-Vulnerable Public Key (RSA / DSA / DH)
PQC-GO-AST-003Quantum-Vulnerable Elliptic Curves (ECC) & Pre-Standard PQC Drafts
PQC-GO-AST-001Deprecated & Broken Cryptographic Primitives
IMM-SQLI-001Dynamic SQL String Interpolation or Concatenation Across Polyglot Drivers
IMM-PATH-001Unjailed Filesystem Path Traversal or Symlink Escape Across Polyglot I/O
IMM-CMD-001Dynamic Shell Command Execution Across Polyglot Process APIs
IMM-BOUND-001Unbounded Stream or Payload Allocation Across Polyglot Boundaries
IMM-DESER-001Unsafe Polymorphic Deserialization or Permissive Boundary Decoding
IMM-AUTH-001Unauthenticated or Unguarded State-Mutating Boundary Endpoint
IMM-TIMING-001Non-Constant-Time Secret, HMAC, or Webhook Signature Comparison
IMM-JWT-001Unverified JWT Signature Decoding Before Claims Trust
IMM-SSRF-001Unvalidated Server-Side Request Forgery (SSRF) & Cloud IMDS Exposure
IMM-AICFG-001AI Coding Agent Instruction & MCP Configuration Poisoning
IMM-CSPRNG-001Weak Non-Cryptographic PRNG in Security Token, OTP, or Secret Generation
PQC-COOKIE-4KPQC Wire-Size Rollout Cliffs: 4KB Cookies, SQL VARCHAR(255) & HTTP 431 Headers
PQC-FED-001NSA CNSA 2.0 Category-5 Floor, PIV/CAC & Firmware Signatures
PQC-BANK-002Banking TR-31/TR-34 Key Blocks, Mainframe ICSF & Open Banking FAPI 2.0
PQC-IAM-001Identity (OIDC / SAML / FIDO2 WebAuthn) & Cloud KMS Envelope Keys
PQC-OT-001OT/ICS OPC UA, IEC 62443 Secure Boot & Healthcare DICOM/HL7 FHIR