SasanLabs / VulnerableApp

OWASP VulnerableApp Project: For Security Enthusiasts by Security Enthusiasts.
https://sasanlabs.github.io/VulnerableApp/
Apache License 2.0
291 stars 385 forks source link

Mocked network calls made in SSRFVulnerabilityTest. #447

Closed tkomlodi closed 11 months ago

tkomlodi commented 11 months ago

Re issue #445.

The fix simply mocks the two network requests that happen from the SSRFVulnerabilityTest test. I tried to keep the changes to a minimum, especially to the SSRFVulnerability class. Here I simply moved the network call out to a new getResponseForURLConnection() call, mostly unchanged. This is the method that is mocked from the test.

I ran into some strange Mockito spy behavior which forced the creation of the interim ssrfSpy variable.

Thanks!