-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)ProposalProposal-Acceptedhelp wanted
Milestone
Description
Background: This recent article https://blog.trailofbits.com/2025/06/17/unexpected-security-footguns-in-gos-parsers/ describes (among other things) a number of security weaknesses in Go's encoding/json package. Some of these could be mitigated by better static checking of struct field tags; indeed, the author of the post links to two semgrep rules that enforce these checks. Specifically:
semgrep -c r/trailofbits.go.unmarshal-tag-is-dashsemgrep -c r/trailofbits.go.unmarshal-tag-is-omitempty
Proposal: Let's add these two checks to the structtag analyzer so that users get immediate feedback in their LSP-enabled editor, and whenever they run go vet.
spencerschrock, rittneje, AndrewHarrisSPU, kwjw, yurivish and 6 more
Metadata
Metadata
Assignees
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)ProposalProposal-Acceptedhelp wanted
Type
Projects
Status
Accepted