File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
templated/templateddetector
src/main/java/com/google/tsunami/plugins/detectors/templateddetector/actions Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,17 @@ message HttpAction {
110110 // By default, we follow redirects so this flag can be used to disable this
111111 // behavior.
112112 bool disable_follow_redirects = 1 ;
113+
114+ // Whether the HTTP client exceptions should be ignored.
115+ //
116+ // By default, any HTTP client failure will fail the plugin execution and
117+ // checks are not performed. However, in some cases the tested server might
118+ // just execute a payload and hang forever and the HTTP client will timeout.
119+ //
120+ // Ignoring HTTP client exceptions will allow the workflow to proceed with
121+ // vulnerability verifications, like checking whether callback servers
122+ // received an interaction.
123+ bool ignore_http_client_errors = 2 ;
113124 }
114125
115126 // The HTTP method to use (e.g. GET, POST, ...).
Original file line number Diff line number Diff line change @@ -98,9 +98,16 @@ private boolean run(
9898 try {
9999 response = httpClient .send (requestBuilder .build ());
100100 } catch (IOException e ) {
101- logger .atSevere ().withCause (e ).log (
102- "Action '%s' failed with exception: %s" , action .getName (), e .getMessage ());
103- return false ;
101+ if (httpAction .getClientOptions ().getIgnoreHttpClientErrors ()) {
102+ logger .atWarning ().withCause (e ).log (
103+ "HTTP client failed. Error is ignored and Action '%s' is considered succeeded." ,
104+ action .getName ());
105+ return true ;
106+ } else {
107+ logger .atSevere ().withCause (e ).log (
108+ "Action '%s' failed with exception: %s" , action .getName (), e .getMessage ());
109+ return false ;
110+ }
104111 }
105112
106113 if (this .debug ) {
You can’t perform that action at this time.
0 commit comments