CATS is a REST API Fuzzer and negative testing tool for OpenAPI endpoints. CATS automatically generates, runs and reports tests with minimum configuration and no coding effort. Tests are self-healing and do not require maintenance.
What is the issue?
If any requestBody schema has "ipaddress" field, the cats is generating very long string for this field. Ideally it should generate random IPv4 address
In this file Pet is defined as below:
"Pet": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" }, "ipaddress": { "type": "string" }, "countryCode": { "type": "string", "pattern": "^[A-Z]{2}$" } } },
When we execute HappyPath fuzzer for this file, CATS generates below fuzzed body:
This function is not generating proper IP address. It generated 255 char length for each X in X.X.X.X format. Ideally it should generate integer value from 0-255 for every X.
What is the fix for this issue?
I have added below fix for this issue. if you find it appropriate then please add it.
ip-address-fix.patch
CATS version: 10.3.0
What is the issue? If any requestBody schema has "ipaddress" field, the cats is generating very long string for this field. Ideally it should generate random IPv4 address
In this file Pet is defined as below:
"Pet": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" }, "ipaddress": { "type": "string" }, "countryCode": { "type": "string", "pattern": "^[A-Z]{2}$" } } },
When we execute HappyPath fuzzer for this file, CATS generates below fuzzed body:
"payload": "{"ipaddress":"718951363927897923360586256180007154435308929228851126446436180141171429804609172230175966541623515461280772929060207152401.963566832870923380059481281857380419995538769907442566957194029356142283127464923521227008552846241712373738766797097576278838561608772.689087567263479742349714296829196377275980732993337744196137894166195402548357612062278404841149224582026639901937149506405666469933302.6711145576437248243454401062813189308873159340","countryCode":"WLF","name":"BoheTys","id":9,"tag":"UVB9A"}"
To Reproduce Steps to reproduce the behaviour:
Expected behaviour Valid IPv4 address value should be generated for this field
What is the root cause?
This function is not generating proper IP address. It generated 255 char length for each X in X.X.X.X format. Ideally it should generate integer value from 0-255 for every X.
What is the fix for this issue? I have added below fix for this issue. if you find it appropriate then please add it. ip-address-fix.patch