Skip to content

Free tool · for API owners

API security checker

Test your API the way an attacker would: endpoints that answer without a login, fake tokens, and one account reading another’s records. With a fix for each problem.

Quick check: any API, no sign-up

Paste an API address (one that answers with JSON) and choose “This page only”. It reads what the API sends everyone: HTTPS, certificate, CORS, cookies and headers.

What to scan

Reads your OpenAPI file

JSON or YAML, OpenAPI 3 or Swagger 2. It tests up to 40 endpoints, and knows which ones you marked public.

Tries fake tokens

A made-up token, your token re-signed with “alg: none”, with its signature removed or changed. Each one should be refused.

Two accounts, one question

Can account 2 open account 1’s records? It’s the most common serious API hole, and a scanner can’t find it without two logins.

Reads, never changes

Your logins are only sent with GET. Changing methods go without a login, to a record that can’t exist. Logins are deleted when the test starts.

For API owners · free

The full API test

Six tests from the OWASP API Security Top 10, run from your API’s description. Because they send fake tokens and unexpected requests, they only run on domains you’ve verified are yours.

Endpoints need a login
An endpoint that should need a login but answers without one hands your data to anyone who finds the address. API addresses are easy to find: they’re in your app and your website’s code.
Fake and tampered tokens are refused
If the API accepts a made-up token, an expired one, or a login token whose signature has been removed (“alg: none”), anyone can make themselves a login.
One account can’t read another’s records
The most common serious API hole (OWASP’s number one): change the number in /orders/1041 to /orders/1042 and see someone else’s order. Logins alone don’t stop it; each record has to check who owns it.
Only the expected methods work
TRACE can echo logins back to attackers, and a PUT or DELETE that works without a login (when the API only meant to allow reading) lets anyone change or wipe records.
Rate limiting
Without a limit on requests, anyone can guess passwords, codes and record numbers as fast as your server answers, or run up your hosting bill.
Errors don’t give away internals
Stack traces, SQL errors and file paths in error messages tell attackers which software, database and folders you use, and sometimes how to break in.

The report also includes the quick check’s server checks for the API’s address, in one grade. Verification lasts 90 days and is checked again before each test. Up to 10 record addresses and 5 tests per domain a day.

1Your API’s domain, and where to send the report

How to test your API’s security

  1. 1Run the quick check on your API’s address: it needs nothing from you and works on any API.
  2. 2For the full test, verify your domain with a DNS record or a file (once; it lasts 90 days).
  3. 3Give it your OpenAPI file and, ideally, two test accounts’ logins and a few of the first account’s record addresses.
  4. 4Start the test. In about a minute you get a grade, what failed, and a fix with code for each problem.

The guide

How to fix each problem

What to do, then the code for Express, Laravel, Django, FastAPI and the common servers. Open the one you use and copy it. The API test’s items come first, then the quick check’s.

Endpoints need a login

An endpoint that should need a login but answers without one hands your data to anyone who finds the address. API addresses are easy to find: they’re in your app and your website’s code.

  1. Put the login check in one place that every route passes through (middleware), and make it refuse by default: a route is public only if you mark it public.
  2. Answer 401 for a missing or invalid login, without any data in the body.
  3. Mark public endpoints in your OpenAPI file with “security: []”, so the description and the code agree.
Express (Node.js)
// Every route needs a login unless it's listed here
const PUBLIC = new Set(['/health', '/login']);
app.use((req, res, next) => {
  if (PUBLIC.has(req.path)) return next();
  const user = verifyToken(req.get('Authorization'));
  if (!user) return res.status(401).json({ error: 'Login required' });
  req.user = user;
  next();
});
Laravel
// routes/api.php: put every private route inside the auth group
Route::middleware('auth:sanctum')->group(function () {
    Route::apiResource('orders', OrderController::class);
});
Django REST framework (settings.py)
REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.IsAuthenticated'],
}
FastAPI
app = FastAPI(dependencies=[Depends(get_current_user)])  # every route needs a login
# public routes go on a separate router without the dependency

Fake and tampered tokens are refused

If the API accepts a made-up token, an expired one, or a login token whose signature has been removed (“alg: none”), anyone can make themselves a login.

  1. Check the token’s signature on every request with a maintained library, and pin the algorithm you use (for example only HS256 or RS256). Never accept “none”.
  2. Check the expiry (exp) and, if you use them, the issuer and audience.
  3. Don’t write your own token checking: use the library’s verify function, not decode.
Node.js (jsonwebtoken)
const user = jwt.verify(token, SECRET, { algorithms: ['HS256'] }); // throws on a bad, expired or unsigned token
// never jwt.decode(token) to log someone in: it doesn't check anything
Python (PyJWT)
user = jwt.decode(token, SECRET, algorithms=['HS256'])  # the algorithms list is required
PHP (firebase/php-jwt)
$user = JWT::decode($token, new Key($secret, 'HS256'));

One account can’t read another’s records

The most common serious API hole (OWASP’s number one): change the number in /orders/1041 to /orders/1042 and see someone else’s order. Logins alone don’t stop it; each record has to check who owns it.

  1. For every record an endpoint returns, check it belongs to (or is shared with) the logged-in user, not just that someone is logged in.
  2. Easiest: look records up through the user (“this user’s order 1042”), so another user’s record simply isn’t found and the API answers 404.
  3. Test it: log in as two users and try to open each other’s records. Random IDs (UUIDs) make guessing harder but don’t replace the check.
Express + an ORM
app.get('/orders/:id', async (req, res) => {
  const order = await Order.findOne({ where: { id: req.params.id, userId: req.user.id } });
  if (!order) return res.status(404).json({ error: 'Not found' });
  res.json(order);
});
Laravel (policy)
public function view(User $user, Order $order): bool
{
    return $order->user_id === $user->id;
}
// in the controller: $this->authorize('view', $order);
Django REST framework
class OrderViewSet(viewsets.ModelViewSet):
    def get_queryset(self):
        return Order.objects.filter(user=self.request.user)

Only the expected methods work

TRACE can echo logins back to attackers, and a PUT or DELETE that works without a login (when the API only meant to allow reading) lets anyone change or wipe records.

  1. Switch TRACE off on the web server.
  2. Register each route only for the methods it supports, so anything else answers 405 Method Not Allowed.
  3. Make sure changing methods (POST, PUT, PATCH, DELETE) need a login and the right role, just like reading does.
nginx (inside server { })
if ($request_method = TRACE) { return 405; }
Apache
TraceEnable off
IIS (web.config)
<security>
  <requestFiltering>
    <verbs>
      <add verb="TRACE" allowed="false" />
    </verbs>
  </requestFiltering>
</security>

Rate limiting

Without a limit on requests, anyone can guess passwords, codes and record numbers as fast as your server answers, or run up your hosting bill.

  1. Limit requests per login and per IP address, with tighter limits on logins, password resets and anything that sends SMS or email.
  2. Answer 429 Too Many Requests with a Retry-After header, and send RateLimit headers so well-behaved apps can slow down.
  3. A limit at the edge (nginx, Cloudflare) protects the server itself; one in the app can count per user.
nginx
# in http { }
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
# in the API's location { }
limit_req zone=api burst=20 nodelay;
limit_req_status 429;
Express (express-rate-limit)
import rateLimit from 'express-rate-limit';
app.use('/api/', rateLimit({ windowMs: 60_000, limit: 120, standardHeaders: 'draft-7' }));
Laravel
Route::middleware(['auth:sanctum', 'throttle:60,1'])->group(function () { /* … */ });
Cloudflare
Security → WAF → Rate limiting rules → Create rule
  When: URI Path starts with /api/
  Rate: 100 requests per 1 minute per IP → Block

Errors don’t give away internals

Stack traces, SQL errors and file paths in error messages tell attackers which software, database and folders you use, and sometimes how to break in.

  1. Switch debug mode off in production.
  2. Catch errors in one place, log the details on the server, and send the caller only a short message and a reference number.
  3. Use the right status codes (400, 404, 500) with the same plain body every time.
Express
app.use((err, req, res, next) => {
  const ref = crypto.randomUUID();
  console.error(ref, err);
  res.status(err.status || 500).json({ error: 'Something went wrong', ref });
});
Laravel (.env)
APP_DEBUG=false
APP_ENV=production
Django (settings.py)
DEBUG = False
PHP (php.ini)
display_errors = Off
log_errors = On

Secure connection (HTTPS)

Without HTTPS, anyone on the same Wi-Fi or network can read and change what your visitors send and see, including passwords and card details.

  1. Get a free certificate from Let’s Encrypt. Most hosts do it with one click: in cPanel it’s SSL/TLS Status → Run AutoSSL.
  2. On your own server, certbot gets the certificate and renews it every 60–90 days by itself.
  3. Then make the http:// address redirect to https:// (next item).
Ubuntu server with nginx
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
Ubuntu server with Apache
sudo apt install certbot python3-certbot-apache
sudo certbot --apache -d example.com -d www.example.com
Cloudflare
SSL/TLS → Overview → Full (strict)
(Put a certificate on your server too: “Flexible” leaves the link from Cloudflare to your server unprotected.)

http:// redirects to https://

People still type the address without https. If the plain http version doesn’t redirect, they use the site unprotected.

  1. Send every http:// request to the same address on https:// with a permanent (301) redirect.
  2. In WordPress, also set both addresses in Settings → General to https://.
nginx
server {
  listen 80;
  server_name example.com www.example.com;
  return 301 https://$host$request_uri;
}
Apache (.htaccess)
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Cloudflare
SSL/TLS → Edge Certificates → Always Use HTTPS: On

Security certificate

An expired or wrong certificate makes browsers show a full-page warning, and old TLS versions have known weaknesses.

  1. An expired certificate: renew it now (certbot renew, or ask your host) and check that automatic renewal is switched on.
  2. A certificate for the wrong name: get one that covers every address you use, with and without www.
  3. Old TLS versions: allow only TLS 1.2 and 1.3. Every browser from the last ten years supports them.
Check certbot renews by itself
sudo certbot renew --dry-run
systemctl list-timers | grep certbot
nginx: modern TLS only
ssl_protocols TLSv1.2 TLSv1.3;
Apache: modern TLS only
SSLProtocol -all +TLSv1.2 +TLSv1.3
Cloudflare
SSL/TLS → Edge Certificates → Minimum TLS Version: TLS 1.2

Always use HTTPS (HSTS)

Tells browsers to never load your site over plain http, even if someone clicks an old http:// link or an attacker tries to downgrade the connection.

  1. Only turn this on once HTTPS works on every page, and on every subdomain if you add includeSubDomains: browsers will refuse plain http for as long as max-age says.
  2. Start with a short max-age (300 seconds), check nothing breaks, then raise it to a year (31536000).
nginx (inside the server { } block, then reload nginx)
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
Apache (.htaccess or the site config; needs mod_headers)
<IfModule mod_headers.c>
  Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
</IfModule>
Cloudflare
SSL/TLS → Edge Certificates → HTTP Strict Transport Security (HSTS) → Enable
  Max Age: 12 months, Include subdomains: only if all of them use HTTPS
Next.js (next.config.js)
async headers() {
  return [{ source: '/(.*)', headers: [
    { key: 'Strict-Transport-Security', value: "max-age=31536000; includeSubDomains" },
  ] }];
}

X-Content-Type-Options

Stops browsers guessing a file’s type, so an uploaded “image” can’t be run as a script.

  1. Add it once, where your site’s other settings are. If you use Cloudflare, a Transform Rule does it for every page without touching the server.
nginx (inside the server { } block, then reload nginx)
add_header X-Content-Type-Options "nosniff" always;
Apache (.htaccess or the site config; needs mod_headers)
<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
</IfModule>
Cloudflare
Rules → Transform Rules → Modify Response Header → Create rule
  When: All incoming requests
  Then: Set static  X-Content-Type-Options  =  nosniff
Next.js (next.config.js)
async headers() {
  return [{ source: '/(.*)', headers: [
    { key: 'X-Content-Type-Options', value: "nosniff" },
  ] }];
}
WordPress
Ask your host to add the header, or install a security-headers plugin (Plugins → Add New → search “security headers”) and switch it on there.

Cookie settings

Login and session cookies need Secure (HTTPS only), HttpOnly (scripts can’t steal them) and SameSite (other sites can’t use them) to protect your visitors’ accounts.

  1. Set the flags where the cookie is made: in the app or CMS settings, or in PHP for PHP sites.
  2. Secure: only sent over HTTPS. HttpOnly: page scripts can’t read it (so an injected script can’t steal a login). SameSite=Lax: not sent when another site makes the request.
  3. Cookies that scripts need to read on purpose (a cookie-banner choice, for example) can stay without HttpOnly.
PHP (php.ini, or ask your host)
session.cookie_secure = 1
session.cookie_httponly = 1
session.cookie_samesite = "Lax"
Node.js / Express
res.cookie('session', value, { secure: true, httpOnly: true, sameSite: 'lax' });
nginx in front of an app (nginx 1.19.3 or newer)
proxy_cookie_flags ~ secure httponly samesite=lax;
WordPress (wp-config.php, above “That’s all”)
@ini_set('session.cookie_secure', 1);
@ini_set('session.cookie_httponly', 1);
@ini_set('session.cookie_samesite', 'Lax');

Software versions hidden

Headers like “Server: Apache/2.4.29” or “WordPress 5.8” tell attackers exactly which known holes to try. Hiding them costs nothing.

  1. Turn off the version numbers in your server’s headers and your CMS’s generator tag. It doesn’t fix holes, but it stops telling attackers which ones to try.
  2. Then keep the software itself updated: hiding an old version is not the same as fixing it.
nginx (http { } block)
server_tokens off;
Apache (main config)
ServerTokens Prod
ServerSignature Off
PHP (php.ini): removes X-Powered-By: PHP/…
expose_php = Off
WordPress (your theme’s functions.php)
remove_action('wp_head', 'wp_generator');
Express
app.disable('x-powered-by');
Next.js (next.config.js)
poweredByHeader: false,

Other sites can’t read your data (CORS)

If your server trusts any website that asks, a malicious page can read your logged-in visitors’ data from it. We test by asking as a made-up site.

  1. Don’t copy the visitor’s Origin header back into Access-Control-Allow-Origin. List the exact sites that need access instead.
  2. Never combine Access-Control-Allow-Credentials: true with “*” or with a copied origin.
  3. If no other site needs to read your data, remove the CORS headers altogether.
Express (cors package)
app.use(cors({ origin: ['https://app.example.com'], credentials: true }));
nginx: allow one exact site
set $cors "";
if ($http_origin = "https://app.example.com") { set $cors $http_origin; }
add_header Access-Control-Allow-Origin $cors always;
add_header Vary Origin always;
PHP
$allowed = ['https://app.example.com'];
if (in_array($_SERVER['HTTP_ORIGIN'] ?? '', $allowed, true)) {
  header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
  header('Vary: Origin');
}

Email: SPF record

Lists the servers allowed to send email for your domain, so others can’t easily send emails pretending to be you.

  1. Add one TXT record on your domain (Name: @) listing who sends your email. Use the line from your email provider.
  2. Only one SPF record per domain: if you use two providers, put both includes in the same record.
  3. End it with ~all or -all. Never +all, which lets anyone send as you.
Google Workspace
Type: TXT   Name: @
v=spf1 include:_spf.google.com ~all
Microsoft 365
Type: TXT   Name: @
v=spf1 include:spf.protection.outlook.com -all
Your host’s mail (cPanel)
Email → Email Deliverability → Repair (it writes the record for you)

Email: DMARC record

Tells Gmail, Outlook and others to reject or quarantine fake emails using your domain. Without it, phishing in your name gets delivered.

  1. Set up SPF first (and DKIM, which your email provider switches on).
  2. Add a TXT record named _dmarc. Start with p=none to receive reports without blocking anything.
  3. After two to four weeks of clean reports, change it to p=quarantine, then p=reject.
Start (monitor only)
Type: TXT   Name: _dmarc
v=DMARC1; p=none; rua=mailto:dmarc@example.com
Goal (fake emails rejected)
Type: TXT   Name: _dmarc
v=DMARC1; p=reject; rua=mailto:dmarc@example.com

Who may issue certificates (CAA)

A DNS record naming the companies allowed to issue certificates for your domain, so nobody else can get one by mistake.

  1. Add a CAA record for each certificate company you use. Let’s Encrypt is the usual one. If you use Cloudflare, it adds the ones it needs automatically.
DNS
Type: CAA   Name: @
0 issue "letsencrypt.org"
0 iodef "mailto:security@example.com"

security.txt contact

A small file at /.well-known/security.txt that tells people who find a problem how to tell you, instead of posting it publicly.

  1. Create a text file at /.well-known/security.txt with a way to contact you and a date to review it by (no more than a year away).
/.well-known/security.txt
Contact: mailto:security@example.com
Expires: 2027-12-31T23:59:59Z
Preferred-Languages: en

Content Security Policy

Lists where your pages may load scripts from. If an attacker manages to inject a script (cross-site scripting), the browser refuses to run it.

  1. Start in “report only” mode: the browser reports what the policy would block (in the developer console) without breaking anything.
  2. Open your pages with the console open, and add each site your pages really load from (analytics, fonts, maps, chat widgets) to the policy.
  3. When nothing is reported any more, rename the header to Content-Security-Policy to switch it on.
  4. Avoid 'unsafe-inline' and 'unsafe-eval' in script-src where you can: they let injected scripts run, which is what the policy is there to stop.
nginx (inside the server { } block, then reload nginx)
add_header Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' https://www.googletagmanager.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https://www.google-analytics.com; frame-ancestors 'self'; object-src 'none'; base-uri 'self'; form-action 'self'" always;
Apache (.htaccess or the site config; needs mod_headers)
<IfModule mod_headers.c>
  Header always set Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' https://www.googletagmanager.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https://www.google-analytics.com; frame-ancestors 'self'; object-src 'none'; base-uri 'self'; form-action 'self'"
</IfModule>
Cloudflare
Rules → Transform Rules → Modify Response Header → Create rule
  When: All incoming requests
  Then: Set static  Content-Security-Policy-Report-Only  =  default-src 'self'; script-src 'self' https://www.googletagmanager.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https://www.google-analytics.com; frame-ancestors 'self'; object-src 'none'; base-uri 'self'; form-action 'self'
Next.js (next.config.js)
async headers() {
  return [{ source: '/(.*)', headers: [
    { key: 'Content-Security-Policy-Report-Only', value: "default-src 'self'; script-src 'self' https://www.googletagmanager.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https://www.google-analytics.com; frame-ancestors 'self'; object-src 'none'; base-uri 'self'; form-action 'self'" },
  ] }];
}
WordPress
Ask your host to add the header, or install a security-headers plugin (Plugins → Add New → search “security headers”) and switch it on there.

Can’t be framed (clickjacking)

Stops other sites showing your pages inside an invisible frame and tricking visitors into clicking buttons they can’t see.

  1. Allow your pages to be framed only by your own site. Set both headers: X-Frame-Options for older browsers, frame-ancestors (in the Content-Security-Policy) for current ones.
nginx (inside the server { } block, then reload nginx)
add_header X-Frame-Options "SAMEORIGIN" always;
Apache (.htaccess or the site config; needs mod_headers)
<IfModule mod_headers.c>
  Header always set X-Frame-Options "SAMEORIGIN"
</IfModule>
Cloudflare
Rules → Transform Rules → Modify Response Header → Create rule
  When: All incoming requests
  Then: Set static  X-Frame-Options  =  SAMEORIGIN
Next.js (next.config.js)
async headers() {
  return [{ source: '/(.*)', headers: [
    { key: 'X-Frame-Options', value: "SAMEORIGIN" },
  ] }];
}
WordPress
Ask your host to add the header, or install a security-headers plugin (Plugins → Add New → search “security headers”) and switch it on there.
In your Content-Security-Policy
frame-ancestors 'self';

Referrer-Policy

Controls how much of your page address is passed to other sites when visitors click a link, so private addresses (reset links, search terms) don’t leak.

  1. Add it once, where your site’s other settings are. If you use Cloudflare, a Transform Rule does it for every page without touching the server.
  2. strict-origin-when-cross-origin sends only your domain to other sites, never the full address.
nginx (inside the server { } block, then reload nginx)
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
Apache (.htaccess or the site config; needs mod_headers)
<IfModule mod_headers.c>
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>
Cloudflare
Rules → Transform Rules → Modify Response Header → Create rule
  When: All incoming requests
  Then: Set static  Referrer-Policy  =  strict-origin-when-cross-origin
Next.js (next.config.js)
async headers() {
  return [{ source: '/(.*)', headers: [
    { key: 'Referrer-Policy', value: "strict-origin-when-cross-origin" },
  ] }];
}
WordPress
Ask your host to add the header, or install a security-headers plugin (Plugins → Add New → search “security headers”) and switch it on there.

Permissions-Policy

Switches off the camera, microphone and location for your pages and anything embedded in them, unless you need them.

  1. Add it once, where your site’s other settings are. If you use Cloudflare, a Transform Rule does it for every page without touching the server.
  2. Leave out any feature your site uses: for example, delete geolocation=() if you have a “find the nearest branch” map.
nginx (inside the server { } block, then reload nginx)
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()" always;
Apache (.htaccess or the site config; needs mod_headers)
<IfModule mod_headers.c>
  Header always set Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()"
</IfModule>
Cloudflare
Rules → Transform Rules → Modify Response Header → Create rule
  When: All incoming requests
  Then: Set static  Permissions-Policy  =  camera=(), microphone=(), geolocation=(), payment=()
Next.js (next.config.js)
async headers() {
  return [{ source: '/(.*)', headers: [
    { key: 'Permissions-Policy', value: "camera=(), microphone=(), geolocation=(), payment=()" },
  ] }];
}
WordPress
Ask your host to add the header, or install a security-headers plugin (Plugins → Add New → search “security headers”) and switch it on there.

Up-to-date JavaScript libraries

Old versions of jQuery, Bootstrap and other libraries have published security holes that automated attacks look for.

  1. WordPress: update WordPress, your theme and every plugin (Dashboard → Updates). An old jQuery usually comes from an old theme or plugin; replace it if it’s no longer updated.
  2. A site you built: update the library to its current version, then test the pages that use it.
  3. Loaded from a CDN: change the version number in the <script> address.
npm projects
npm outdated
npm audit
npm install jquery@latest
From a CDN (current jQuery, with a checksum so a changed file is refused)
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
  integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
  crossorigin="anonymous"></script>

No insecure content (mixed content)

A script, style or frame loaded over http:// on an https page can be swapped by an attacker, which undoes the page’s protection.

  1. Change every http:// address of a script, stylesheet, image or frame on your pages to https://.
  2. WordPress: run a search and replace in the database from http://yourdomain to https://yourdomain (a search-and-replace plugin does it safely; back up first).
  3. As a safety net, the upgrade-insecure-requests setting makes browsers load anything you missed over https.
nginx (inside the server { } block, then reload nginx)
add_header Content-Security-Policy "upgrade-insecure-requests" always;
Apache (.htaccess or the site config; needs mod_headers)
<IfModule mod_headers.c>
  Header always set Content-Security-Policy "upgrade-insecure-requests"
</IfModule>
Cloudflare
Rules → Transform Rules → Modify Response Header → Create rule
  When: All incoming requests
  Then: Set static  Content-Security-Policy  =  upgrade-insecure-requests

Forms send securely

A form that sends to an http:// address, or asks for a password on a page without HTTPS, gives the typed details away to anyone listening.

  1. Serve every page over HTTPS (see the first items), and make each form’s action an https:// address, or a path like /contact that stays on your secure site.
HTML
<form action="/contact" method="post">  <!-- not action="http://…" -->

Questions

Is the API security checker free?
Yes. The quick check works on any API with no sign-up. The full test is for verified owners: up to 5 tests per domain a day, and the report is emailed to you as a PDF.
What do I need for the full test?
Your API’s OpenAPI (Swagger) description, which most frameworks create for you (look for /openapi.json, /swagger.json or /v3/api-docs). For the token and access tests: login headers for two test accounts, and the addresses of a few records that belong to the first, like /orders/1041.
Is it safe to give you my API tokens?
Use tokens for test accounts, never a real customer’s, and ones that expire. They’re encrypted as soon as they reach us, handed to the test runner once, and deleted from our database the moment the test starts. They’re never written to logs, emails or the report. When the test is done, you can revoke them.
Can the test change or delete my data?
It’s built not to. Your logins are only ever sent with GET (reading). PUT, PATCH and DELETE are sent without any login, only on paths your description doesn’t list them for, and only to the record id “wsc-test-does-not-exist”. If your API deletes something there without a login, that’s exactly the hole the test exists to find. Still, test a staging copy if you have one.
Why do I have to verify my domain?
The full test sends fake tokens, unexpected methods and bursts of requests. That’s what an attacker does, so we only do it for an API’s owner. A DNS record covers every name under the domain (api.example.com, too); a file covers only the address it’s on.
What doesn’t it test?
Business logic: a price or quantity you can change in the request, a coupon used twice, a step you can skip. It also doesn’t send injection attacks into your POST bodies. Those need a person who understands your API: that’s a penetration test.
It says one of my endpoints answered without a login, but it’s meant to be public.
Mark it public in your description with “security: []” on that operation. Endpoints the description doesn’t mark either way are reported as “could be better”, not as a failure, unless they gave the same data with and without your login.
Where does the test run from?
From GitHub’s servers, not ours, and it identifies itself as “API test authorised by the owner”. If your firewall blocks it, the rate limit test will look like a pass and the others will say the API didn’t answer.

More free security tools

Need the parts tools can’t see, like prices you can change in a request? Talk to us about a manual test, or see all our free tools.

WhatsApp us