Skip to content

Conversation

cschoenduve-splunk
Copy link
Contributor

This update to rule G304 gives gosec the ability to evaluate two path joining functions as well as binary expressions when inside ioutil.Readfile or os.Open. Gosec can now flag cases like:
ioutil.Readfile("/tmp/" + input + "/blob") and os.Open(filepath.Join("/tmp/", file)). To do this, a new function called FindVarIdentities was added to helpers.go. The function will return all variable identities found in a binary expression.

@gcmurphy
Copy link
Member

@cschoenduve-splunk
Copy link
Contributor Author

Sure! I added 3 new tests.

@gcmurphy
Copy link
Member

Thanks. 👍

@gcmurphy gcmurphy merged commit 7fd9446 into securego:master Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants