Conditional flows
You can execute and compare responses from multiple API calls in YAML tests
This instruction is required when you want to fire multiple API calls and compare their responses. A simple use case is testing for Username enumeration vulnerability using password-reset endpoint.
To configure Akto test YAML for multiple requests, set type: true
Instructions available -
For each request, you can now use
validate
block to test for a certain responsesuccess
to specify which request to execute next ifvalidate
block returns truefailure
to specify which request to execute next ifvalidate
block returns falseAnywhere, you can set
success
orfailure
asvulnerable
(to mark a vulnerability) orexit
Requests are named as
x1
x2
etc. automatically. You can use this to jump to a node onsuccess
orfailure
. You can also use them in data operators (eg response payload ofx1
should have length > 80 characters)
If success
or failure
isn't specified, we jump to the next request. If it's the last request, then we jump to the validate
block of the test.
Example - Try a wrong password. If API returns 4xx, then try with wrong usernames
Next step -
try with invalid usernames, and check if the response string is different. If they are different, then the application is vulnerable to username enumeration.
Complete YAML -
Last updated