Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OpenAPI fuzzing to find mistakes in specifications and general errors in the code #47825

Open
provokateurin opened this issue Sep 7, 2024 · 2 comments
Assignees
Labels

Comments

@provokateurin
Copy link
Member

provokateurin commented Sep 7, 2024

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.
Bugs exist ;)

Describe the solution you'd like
An OpenAPI fuzzer can generate inputs and execute requests against API endpoints as described by the specification.
This can both find problems in the specifications as well as errors in the application code itself.
I already ran a small experiment against https://github.com/matusf/openapi-fuzzer which resulted in a few issues found in the core specification and code.
There is also https://github.com/microsoft/restler-fuzzer which is a lot more complex but also does more advanced mutations and checks for problems in the application logic. I haven't been able to get it properly working yet though.
One major thing I'm interested in is validation of response bodies as I often find problems myself (by hand basically), so an automation there would be great. I haven't yet found a fuzzer that seems to do that, but maybe restler can do it and they just don't mention it anywhere (the other one definitely only checks the status code, i read that part of the code).

A small script to run tests against the specifications in server can be found here: https://gist.github.com/provokateurin/3150b1c98049368bb6f00e7b7f76b1c6 (can be adapted to work with restler later)

@provokateurin provokateurin added enhancement 1. to develop Accepted and waiting to be taken care of labels Sep 7, 2024
@provokateurin provokateurin self-assigned this Sep 7, 2024
@provokateurin
Copy link
Member Author

I found https://github.com/schemathesis/schemathesis while looking for something unrelated and it produces pretty good results, including response schema validation which is really helpful for making sure OpenAPI specifications are correct.

@sorbaugh
Copy link
Contributor

Would be a nice quality improvement!

@provokateurin provokateurin moved this to 📄 To do (~10 entries) in 📁 Files team Nov 25, 2024
@provokateurin provokateurin added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Jan 6, 2025
@provokateurin provokateurin moved this from 📄 To do (~10 entries) to 🏗️ In progress in 📁 Files team Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🏗️ In progress
Development

No branches or pull requests

2 participants