@@ -122,9 +122,9 @@ def check_unsupported_http_methods(
122
122
'malicious_payload' : [],
123
123
'args' : args ,
124
124
'kwargs' : kwargs ,
125
- 'result_details ' : {
126
- True : " Endpoint doesn't perform any HTTP verb which is not documented" ,
127
- False : ' Endpoint performs HTTP verb which is not documented' ,
125
+ 'vuln_details ' : {
126
+ True : ' Endpoint performs HTTP verb which is not documented' ,
127
+ False : " Endpoint doesn't perform any HTTP verb which is not documented" ,
128
128
},
129
129
'body_params' : body_params ,
130
130
'query_params' : query_params ,
@@ -297,9 +297,9 @@ def sqli_fuzz_params_test(
297
297
298
298
request_obj ['malicious_payload' ] = sqli_payload
299
299
300
- request_obj ['result_details ' ] = {
301
- True : 'Parameters are not vulnerable to SQLi Payload' , # passed
302
- False : 'One or more parameter is vulnerable to SQL Injection Attack' , # failed
300
+ request_obj ['vuln_details ' ] = {
301
+ True : 'One or more parameter is vulnerable to SQL Injection Attack' ,
302
+ False : 'Parameters are not vulnerable to SQLi Payload' ,
303
303
}
304
304
request_obj ['success_codes' ] = success_codes
305
305
request_obj [
@@ -404,9 +404,9 @@ def sqli_in_uri_path_fuzz_test(
404
404
'malicious_payload' : sqli_payload ,
405
405
'args' : args ,
406
406
'kwargs' : kwargs ,
407
- 'result_details ' : {
408
- True : 'Endpoint is not vulnerable to SQLi' , # passed
409
- False : 'Endpoint might be vulnerable to SQli' , # failed
407
+ 'vuln_details ' : {
408
+ True : 'Endpoint might be vulnerable to SQli' ,
409
+ False : 'Endpoint is not vulnerable to SQLi' ,
410
410
},
411
411
'success_codes' : success_codes ,
412
412
'response_filter' : PostTestFiltersEnum .STATUS_CODE_FILTER .name ,
@@ -498,9 +498,9 @@ def bola_fuzz_path_test(
498
498
'malicious_payload' : path_params ,
499
499
'args' : args ,
500
500
'kwargs' : kwargs ,
501
- 'result_details ' : {
502
- True : 'Endpoint is not vulnerable to BOLA' , # passed
503
- False : 'Endpoint might be vulnerable to BOLA' , # failed
501
+ 'vuln_details ' : {
502
+ True : 'Endpoint might be vulnerable to BOLA' ,
503
+ False : 'Endpoint is not vulnerable to BOLA' ,
504
504
},
505
505
'success_codes' : success_codes ,
506
506
'response_filter' : PostTestFiltersEnum .STATUS_CODE_FILTER .name ,
@@ -594,9 +594,9 @@ def bola_fuzz_trailing_slash_path_test(
594
594
'malicious_payload' : malicious_payload ,
595
595
'args' : args ,
596
596
'kwargs' : kwargs ,
597
- 'result_details ' : {
598
- True : 'Endpoint might not vulnerable to BOLA' , # passed
599
- False : 'Endpoint might be vulnerable to BOLA' , # failed
597
+ 'vuln_details ' : {
598
+ True : 'Endpoint might be vulnerable to BOLA' ,
599
+ False : 'Endpoint might not vulnerable to BOLA' ,
600
600
},
601
601
'success_codes' : success_codes ,
602
602
'response_filter' : PostTestFiltersEnum .STATUS_CODE_FILTER .name ,
@@ -680,6 +680,9 @@ def bopla_fuzz_test(
680
680
filter (lambda x : x .get ('in' ) == 'path' , request_params )
681
681
)
682
682
683
+ if len (request_body_params ) == 0 and len (request_query_params ) == 0 :
684
+ continue
685
+
683
686
# handle path params from path_params
684
687
# and replace path params by value in
685
688
# endpoint path
@@ -718,9 +721,9 @@ def bopla_fuzz_test(
718
721
'malicious_payload' : response_body_params ,
719
722
'args' : args ,
720
723
'kwargs' : kwargs ,
721
- 'result_details ' : {
722
- True : 'Endpoint might not vulnerable to BOPLA' , # passed
723
- False : 'Endpoint might be vulnerable to BOPLA' , # failed
724
+ 'vuln_details ' : {
725
+ True : 'Endpoint might be vulnerable to BOPLA' ,
726
+ False : 'Endpoint might not vulnerable to BOPLA' ,
724
727
},
725
728
'success_codes' : success_codes ,
726
729
'response_filter' : PostTestFiltersEnum .STATUS_CODE_FILTER .name ,
@@ -774,7 +777,7 @@ def __generate_injection_fuzz_params_test(
774
777
self ,
775
778
openapi_parser : SwaggerParser | OpenAPIv3Parser ,
776
779
test_name : str ,
777
- result_details : dict ,
780
+ vuln_details : dict ,
778
781
payloads_data : list [dict ],
779
782
* args ,
780
783
** kwargs ,
@@ -804,19 +807,19 @@ def __generate_injection_fuzz_params_test(
804
807
for payload_dict in payloads_data :
805
808
for request_obj in fuzzed_request_list :
806
809
payload = payload_dict ['request_payload' ]
807
-
808
- # handle body request params
809
810
body_request_params = request_obj .get ('body_params' , [])
811
+ query_request_params = request_obj .get ('query_params' , [])
812
+ # endpoint can be fuzzed if it has query/body params
813
+ if len (body_request_params ) == 0 and len (query_request_params ) == 0 :
814
+ continue
815
+
816
+ # handle body and query request params
810
817
malicious_body_request_params = self .__inject_payload_in_params (
811
818
body_request_params , payload
812
819
)
813
-
814
- # handle query request params
815
- query_request_params = request_obj .get ('query_params' , [])
816
820
malicious_query_request_params = self .__inject_payload_in_params (
817
821
query_request_params , payload
818
822
)
819
-
820
823
request_obj ['test_name' ] = test_name
821
824
822
825
request_obj ['body_params' ] = malicious_body_request_params
@@ -826,7 +829,7 @@ def __generate_injection_fuzz_params_test(
826
829
827
830
request_obj ['malicious_payload' ] = payload
828
831
829
- request_obj ['result_details ' ] = result_details
832
+ request_obj ['vuln_details ' ] = vuln_details
830
833
request_obj [
831
834
'response_filter'
832
835
] = PostTestFiltersEnum .BODY_REGEX_FILTER .name
@@ -865,15 +868,15 @@ def os_command_injection_fuzz_params_test(
865
868
{'request_payload' : 'ls -la' , 'response_match_regex' : r'total\s\d+' },
866
869
]
867
870
868
- result_details = {
869
- True : 'Parameters are not vulnerable to OS Command Injection' , # passed
870
- False : 'One or more parameter is vulnerable to OS Command Injection Attack' , # failed
871
+ vuln_details = {
872
+ True : 'One or more parameter is vulnerable to OS Command Injection Attack' ,
873
+ False : 'Parameters are not vulnerable to OS Command Injection' ,
871
874
}
872
875
873
876
return self .__generate_injection_fuzz_params_test (
874
877
openapi_parser = openapi_parser ,
875
878
test_name = test_name ,
876
- result_details = result_details ,
879
+ vuln_details = vuln_details ,
877
880
payloads_data = payloads_data ,
878
881
)
879
882
@@ -912,15 +915,15 @@ def xss_html_injection_fuzz_params_test(
912
915
},
913
916
]
914
917
915
- result_details = {
916
- True : 'Parameters are not vulnerable to XSS/HTML Injection Attack' , # passed
917
- False : 'One or more parameter is vulnerable to XSS/HTML Injection Attack' , # failed
918
+ vuln_details = {
919
+ False : 'Parameters are not vulnerable to XSS/HTML Injection Attack' ,
920
+ True : 'One or more parameter is vulnerable to XSS/HTML Injection Attack' ,
918
921
}
919
922
920
923
return self .__generate_injection_fuzz_params_test (
921
924
openapi_parser = openapi_parser ,
922
925
test_name = test_name ,
923
- result_details = result_details ,
926
+ vuln_details = vuln_details ,
924
927
payloads_data = payloads_data ,
925
928
)
926
929
@@ -968,15 +971,15 @@ def ssti_fuzz_params_test(self, openapi_parser: SwaggerParser | OpenAPIv3Parser)
968
971
{'request_payload' : r'*{7*7}' , 'response_match_regex' : r'49' },
969
972
]
970
973
971
- result_details = {
972
- True : 'Parameters are not vulnerable to SSTI Attack' , # passed
973
- False : 'One or more parameter is vulnerable to SSTI Attack' , # failed
974
+ vuln_details = {
975
+ True : 'One or more parameter is vulnerable to SSTI Attack' ,
976
+ False : 'Parameters are not vulnerable to SSTI Attack' ,
974
977
}
975
978
976
979
return self .__generate_injection_fuzz_params_test (
977
980
openapi_parser = openapi_parser ,
978
981
test_name = test_name ,
979
- result_details = result_details ,
982
+ vuln_details = vuln_details ,
980
983
payloads_data = payloads_data ,
981
984
)
982
985
@@ -993,7 +996,7 @@ def missing_auth_fuzz_test(
993
996
openapi_parser (OpenAPIParser): An instance of the OpenAPIParser class
994
997
containing the parsed OpenAPI specification.
995
998
success_codes (list[int], optional): A list of HTTP success codes to consider
996
- as successful BOLA responses. Defaults to [200, 201, 301].
999
+ as test failed responses. Defaults to [200, 201, 301].
997
1000
*args: Variable-length positional arguments.
998
1001
**kwargs: Arbitrary keyword arguments.
999
1002
@@ -1069,9 +1072,9 @@ def missing_auth_fuzz_test(
1069
1072
'malicious_payload' : 'Security Payload Missing' ,
1070
1073
'args' : args ,
1071
1074
'kwargs' : kwargs ,
1072
- 'result_details ' : {
1073
- True : 'Endpoint implements security authentication as defined' , # passed
1074
- False : 'Endpoint fails to implement security authentication as defined' , # failed
1075
+ 'vuln_details ' : {
1076
+ True : 'Endpoint fails to implement security authentication as defined' ,
1077
+ False : 'Endpoint implements security authentication as defined' ,
1075
1078
},
1076
1079
'success_codes' : success_codes ,
1077
1080
'response_filter' : PostTestFiltersEnum .STATUS_CODE_FILTER .name ,
0 commit comments