[Paper Review] Pythia: Grammar-Based Fuzzing of REST APIs with Coverage-guided Feedback and Learning-based Mutations
Pythia is a novel fuzzer that enhances grammar-based fuzzing of stateful REST APIs by integrating coverage-guided feedback and a learning-based mutation strategy. It learns common API usage patterns from seed inputs and generates syntactically valid, semantically plausible mutations to improve code coverage and bug detection, outperforming prior tools by finding 29 new bugs in production-scale cloud services.
This paper introduces Pythia, the first fuzzer that augments grammar-based fuzzing with coverage-guided feedback and a learning-based mutation strategy for stateful REST API fuzzing. Pythia uses a statistical model to learn common usage patterns of a target REST API from structurally valid seed inputs. It then generates learning-based mutations by injecting a small amount of noise deviating from common usage patterns while still maintaining syntactic validity. Pythia's mutation strategy helps generate grammatically valid test cases and coverage-guided feedback helps prioritize the test cases that are more likely to find bugs. We present experimental evaluation on three production-scale, open-source cloud services showing that Pythia outperforms prior approaches both in code coverage and new bugs found. Using Pythia, we found 29 new bugs which we are in the process of reporting to the respective service owners.
Motivation & Objective
- Address the limitations of existing grammar-based fuzzers that use fixed, hand-crafted values and lack feedback mechanisms.
- Improve the effectiveness of stateful REST API fuzzing by combining coverage-guided feedback with learning-based mutation strategies.
- Enable deeper testing of production-scale cloud services by generating semantically plausible, grammatically valid test cases.
- Reduce the combinatorial explosion in fuzzing rules while maintaining high test diversity and coverage.
- Discover new, previously unknown bugs in real-world, open-source cloud services with complex REST APIs.
Proposed method
- Uses a statistical model (seq2seq autoencoder) to learn common usage patterns from structurally valid seed inputs to the target REST API.
- Applies a learning-based mutation strategy that injects small, controlled noise deviating from learned patterns while preserving syntactic validity.
- Integrates coverage-guided feedback to prioritize test cases that exercise new code paths and increase code coverage.
- Leverages static analysis of target service source code to extract basic blocks for measuring code coverage during fuzzing.
- Automatically generates grammar-based test sequences from OpenAPI specifications to model stateful interactions across multiple API requests.
- Combines grammar-based generation with feedback-driven test case prioritization to enhance exploration of deep application states.
Experimental results
Research questions
- RQ1Can a learning-based mutation strategy improve the effectiveness of grammar-based fuzzing for stateful REST APIs compared to fixed-value approaches?
- RQ2To what extent does coverage-guided feedback enhance code coverage and bug detection in complex, structured input formats like REST APIs?
- RQ3How effective is Pythia in discovering new, previously unknown bugs in production-scale cloud services compared to prior tools?
- RQ4Can a statistical model trained on seed inputs generate meaningful, syntactically valid mutations that increase test diversity and coverage?
- RQ5Does the integration of learning-based mutations with coverage feedback lead to measurable improvements in fuzzing efficiency and bug-finding capability?
Key findings
- Pythia achieved significantly higher code coverage than prior approaches when testing three production-scale, open-source cloud services.
- Pythia discovered 29 new, previously unknown bugs across GitLab, Mastodon, and Spree, all of which are being reported to the respective service owners.
- The learning-based mutation strategy successfully generated grammatically valid test cases that deviated from common usage patterns while remaining syntactically correct.
- Coverage-guided feedback effectively prioritized test cases that exercised new code paths, improving the efficiency of bug discovery.
- The integration of learning-based mutations with coverage feedback led to a measurable improvement in both code coverage and the number of unique bugs found.
- Pythia demonstrated strong scalability and effectiveness on services with over 200 distinct API request types, confirming its utility in real-world, complex systems.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.