Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G107 - SSRF #236

Merged
merged 6 commits into from
Sep 4, 2018
Merged

G107 - SSRF #236

merged 6 commits into from
Sep 4, 2018

Conversation

cschoenduve-splunk
Copy link
Contributor

This PR is implementing the SSRF rule from PR 189. I have many small changes and added the ability to look at the last selector in a Call expression and compare that to the selectors passed in from net/http. This will catch wrapped clients as well as other libraries exposing GET/POST/HEAD/PUT methods. One downside is that it cannot resolve that selector's originating type and therefore may flag false positives. The current way of resolving the url variable also leads to some false positives but I have some ideas to fix this later.

Please let me know what you think.

rules/ssrf.go Show resolved Hide resolved
@ccojocar
Copy link
Member

ccojocar commented Sep 3, 2018

@cschoenduve-splunk Please could you have a look at the unit tests? It seems that there are some tests which are failing.

@ccojocar ccojocar mentioned this pull request Sep 3, 2018
@cschoenduve-splunk
Copy link
Contributor Author

@ccojocar The error appears because I am using the go-resty library in one of the unit tests but I forgot that I already had the package on my local machine. I will remove that test because I do not think there is a way to add the package dependency through dep.

@ccojocar
Copy link
Member

ccojocar commented Sep 4, 2018

@cschoenduve-splunk If you want to add go-resty to cover that indirect use cases, it has to be installed in .travis file with go get because sample code is parsed dynamically when the tests are executed.

@ccojocar ccojocar merged commit 419c929 into securego:master Sep 4, 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