Skip to main content

Overview

The API headers scanner makes an HTTP request to your API and checks the response headers against security best practices. It runs on scan api targets.

Usage

Headers checked

Header recommendations

Strict-Transport-Security (HSTS)

Tells browsers to only connect over HTTPS. Without this, a man-in-the-middle attack can downgrade the connection to HTTP.

Content-Security-Policy

Controls what resources the browser is allowed to load. Prevents XSS by restricting inline scripts and external resource loading.

X-Content-Type-Options

Prevents MIME type sniffing. Without this, browsers may interpret files as executable content even when served with a safe MIME type.

X-Frame-Options

Prevents your app from being embedded in iframes, blocking clickjacking attacks.

Referrer-Policy

Controls how much referrer information is sent with requests. Without this, sensitive URL parameters may leak to third parties.

Express.js setup (Node.js)

Use helmet to set all security headers in one line:

FastAPI setup (Python)

CORS configuration

A wildcard Access-Control-Allow-Origin: * allows any website to make requests to your API — including reading the response. This is only safe for public, unauthenticated data.
The API scanner only tests the response headers of the target URL. It does not attempt authentication, send a request body, or test API logic. For code-level security analysis, use scan repo.