liveBook · Manning

Misconfiguration

As explained in Secure APIs

A misconfiguration is a security-relevant condition in which system or application settings are incorrect, unsafe, or insufficiently restrictive.

A misconfiguration is an incorrect, unsafe, or insufficiently restrictive service setting that opens a security hole. In APIs, it can expose internal information, sensitive data, credentials, or operations to people who should not reach them. section 5.4

Common failures include leaving debug mode enabled, exposing internal APIs publicly, omitting authorization checks, making storage publicly accessible, and leaking API keys in client code. Attackers use the resulting information or access to plan attacks and reach confidential data. section 5.4

Debug mode leaks an API's internals

A GET /users endpoint accepts an order_by parameter. With FastAPI(debug=True), requesting /users?order_by=asdf produces a full stack trace containing file paths, runtime and library details, database information, code context, and the generated query. Set debug to False across every environment; also restrict order_by to an enumeration and verify fields before querying. section 5.5

Reduce misconfiguration risk by:

  • Automate deployments and configuration management. section 5.9
  • Run smoke tests that detect common configuration errors. section 5.9
  • Treat internal APIs as public and protect them with authorization. section 5.4

How Secure APIs covers it

How deep it goes
Defines major failure modes, works through debug leakage, and recommends configuration management and smoke tests.
Examples
Demonstrates an invalid order_by request producing a stack trace from a debug-enabled users endpoint.
What it assumes
Assumes basic familiarity with API endpoints and deployment settings while explaining the security consequences from first principles.
What you can do after
Diagnose configuration leaks with smoke tests and harden deployments by disabling debug mode and automating settings.
How it connects
Connects misconfiguration with debug mode, stack traces, authorization, internal APIs, and API attack surface.

Also explained in

Compare how 2 books explain misconfiguration →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.