EN, Change language
Englishالعربية
JO-174

APIs use HTTPS and never expose usernames, passwords, session tokens or API keys in URLs.

The requirement (from the 2022 Guidelines)

APIs use HTTPS and never expose usernames, passwords, session tokens or API keys in URLs.

Why it matters to users

Tokens or API keys sent in a URL end up in browser history, server logs and referrer headers on other sites. Anyone who sees them can act as the user or call your services without permission.

How to fix it

Call every API over HTTPS, move session tokens, API keys and credentials out of URLs into request headers or the body, and revoke and replace any key that has appeared in a public URL. Then scan again.

How we measure it

Scan page source, links and XHR URLs for http:// API calls and token/key parameters. Partly measured: we measure what the public pages show of this rule; the rest needs a review.

Other API controls (OAuth2, rate limits, IP filtering, opaque IDs, timestamps) are manual.

Its place in the MODEE guidelines

Related rules

Secure APIs, no keys in URLs · Jordan JO-174 | xfix