Hi,
ZAP does not seem to be able to properly identify the multipart form-data inside OpenApi/Swagger specifications.
I have actually tried both Swagger(v2) and OpenApi(v3) and there seem to be the same behaviour.
Inside the Petstore definition, there is a POST operation to upload an image using multipart form-data for a file.
Now, the problem lies when importing this openapi into ZAP, as it does not seem to properly identify/attack the parameters from the multipart form-data (note there is no Content-Type and the body is empty):
If a call is made to this path using a client (i.e. Postman) and having ZAP in proxy mode, then ZAP will correctly show the Content-Type and show the proper body with boundaries and Content-Disposition.
Example:
Header
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Body:
------WebKitFormBoundary7MA4YWxkTrZu0gW--,------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="file"; filename="/test.txt
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Note: ZAP has the Multipart Form-data input vector enabled in the Active scan, but there seem to be no difference in properly identifying the multipart form-data parameters and being able to attack them.
Unless I am missing something, the only way of scanning multipart form-data requests is to proxy them thorough ZAP, and not use the openapi import