Go Gin (Go) · CWE-915
Go Gin: BOPLA & Mass Assignment (Code Remediation)
Implement fail-closed guards and safe data filters. Prevent callers from overwriting role, isAdmin, balance, or orgId fields through DTO inputs. Tailored for Go Gin: Validate JWT claims explicitly and bind outbound HTTP clients against private IPs.
Coverage ledger tracking key
surface:go-gin::boundary:mass-assignment::angle:remediation
Schema diff probing privileged body keys
Risk boundary
// Unverified Go Gin path (CWE-915 · Code Remediation)
// Handler accepts input without validating c.GetString("userId").Hardened guard
// Hardened Go Gin (CWE-915 · Code Remediation)
// 1. Validate JWT claims explicitly and bind outbound HTTP clients against private IPs
// 2. Allowlist explicit DTO fields cleanly before saving and project response payloads safely.Verification steps
- 01Seed coverage-ledger.json for every Go Gin handler touching BOPLA & Mass Assignment.
- 02Trace request parameters through c.GetString("userId") validation down to the sink.
- 03Verify with paired positive/negative evidence via finding-verification-triage.