Closed ganeshnikam18 closed 6 months ago
For POST/PUT/PATCH fuzzing is only happening at the request body level. Any path parameter must be supplied through the --urlParams
argument. In your case it must be something like:
cats [OTHER ARGS] --urlParams "orderId:12345"
You can also use the -refData
argument to supply a ref data file:
cats [OTHER ARGS] --refData refData.yaml
and refData.yaml
has the following content:
/test1/{orderId}:
orderId: 12345
I have checked both the option which you have mentioned. But these options are useful for parameters where we want to provide fix value for that path parameters. This may not be case for all path parameters. Like is above example "orderId" is a random number which is generated when that object is created in POST request.
For very large files, where there are large number of path parameters user may not create refData file.
For such parameters we should exploit it with different fuzzers for PUT/PATCH type of requests to validate the server's implementation.
So I think we should also fuzz the path parameters if --urlParams OR refData is not given.
It seems like a good feature to have. I'll implement a fuzzer specific for this case. The current mechanism does not support simultaneous fuzzing for url and body.
@en-milie Does your fix in this commit add the fix for above issue ?
https://github.com/Endava/cats/commit/d368303a7b38e7ee0e831be676d6685682b149de
@ganeshnikam18 No. It's this one: https://github.com/Endava/cats/commit/2d5318286291491e7437ea4b5fe9e0432a4d1c94
I will close this now.
Sample OpeAPI Definition:
What is the issue ? When CATS tool fuzzes above API for HappyPath Fuzzer, it does not fuzz the 'orderId' path parameter. The url is create like this: https://apiserver.com/test1/{oderId}
The requestBody (Order object) is fuzzed properly
Expected Behaviour Ideally the 'orderId' path parameter should be fuzzed. Reference from Swagger Doc: https://swagger.io/docs/specification/describing-parameters/#path-parameters
For GET and DELETE method, the path parameter is fuzzed properly