Skip to content

x/vulndb: govulncheck surfaces function calls with trusted input (e.g., GO-2022-1039) #56099

@ghost

Description

Report ID

GO-2022-1039

Suggestion/Comment

The content of the warning is:

calls regexp.MustCompile, which eventually calls regexp/syntax.Parse

My code does indeed call MustCompile, but all of the non-test call sites pass in a literal string to the regex. As such, the call is trusted. If I undestand this vulnerability report correctly, it effectively means we can't ever use regexes and get a clean bill of health from govulncheck.

package main

import (
	"fmt"
	"regexp"
)

var re = regexp.MustCompile("trusted")

func main() {
	fmt.Println(re.String())
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.UXIssues that involve UXD/UXR inputvulncheck or vulndbIssues for the x/vuln or x/vulndb repo

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions