Detecting HTTP Status Code Misuses in REST APIs via Static and Dynamic Analysis
Alix Decrop, Andrea Arcuri, Mike Papadakis, Pierre-Yves Schobbens, Gilles Perrouin
Abstract
REST APIs are widely used on the web for client-server communications. As REST is based on HTTP, server responses contain status codes to indicate the outcome of requests (e.g., 200 OK for a success and 404 Not Found for an unavailable resource). While HTTP status codes are standardized, their semantics are not enforced in REST, leading to many misuses in practice (e.g., using 500 Internal Server Error to describe a client error). Such misuses may have nefarious consequences, such as reducing interoperability, misleading API clients, or causing false positives in testing tools. In this paper, we present a combined static and dynamic analysis approach for detecting HTTP status code misuses in REST APIs. We first study 2,625 real-world REST API specifications to identify relevant status codes and derive a set of 30 usage rules based on HTTP standards and REST API principles. We then implement tools to identify such rule violations in OpenAPI specifications (static analysis) and in API behavior (dynamic analysis). Our evaluation finds that status code misuses are frequent and systematic in REST APIs, with both static and dynamic approaches detecting various misuses. We highlight that both approaches may be used in a complementary manner, and also provide insight for REST API testers and users alike.
Create a lesson
Related papers
Beyond Establishing the Four-Day Workweek: Understanding Adaptation and Long-Term Survival in an Agile Software Organization
Michael Neumann, Darja Šmite
Involving before Evolving: A Vision for Trustworthy Enterprise Digital Twin Engineering
Kérian Fiter, Adil Lagrou, Franck Dervault et al.
Intelligent Semantic Matching (ISM) for Video Tutorial Search using Transformer Models
Ahmad J. Tayeb, Sonia Haiduc
GraphAHA: Graph-Based Adaptive Search with Heterogeneous Actions for Test-Time Code Generation
Xitao Li, Haijun Wang, Gege Yuan et al.
What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code
Cristina Improta, Pietro Liguori, Domenico Cotroneo
Separating Engineering Reasoning from DEXPI Serialization in LLM-Based Greenfield Surface-Process Design: A Three-Case Study for Underground Gas Storage
Qingchuan Zhu, Shuyue Tong, Pengju Ren