What it finds on a demo project

In hand-written sign-in flows, the CLI points out callbacks that never check state and code exchanges that send neither a PKCE verifier nor a client secret.

SiteCMD CLI 2.0.0
Demo project: OAuth callback route
npx sitecmd audit .
SiteCMD Code Scan - .
Checked: November 9, 2026
Framework: Express
Issues: 2 total | critical 0 | high 2 | medium 0 | low 0

High (2)
- [Security · security] No recognized OAuth state binding in manual callback - src/routes/oauth-callback.js:8
- [Security · security] No recognized PKCE or client authentication in manual code exchange - src/routes/oauth-callback.js:13

Your code passes? Now watch your site.

Join the waitlist

Validate the OAuth state parameter on the callback

If you use state to bind the flow to the browser, generate a one-use value tied to the session that started it and check it on return. Don't complete the flow if the value is missing, changed or reused. RFC 9700 sets out the CSRF requirements.

Follow the PKCE flow from challenge to code exchange

PKCE sends a challenge with the authorization request and the matching verifier when exchanging the code. Use the S256 challenge method and keep the verifier tied to that sign-in attempt. A copied authorization code alone shouldn't complete the exchange. RFC 7636 defines how it works.

Frequently asked questions

Does the PKCE flow replace OAuth state?

RFC 9700 allows PKCE to provide CSRF protection if you've confirmed the authorization server supports it and correctly tied the flow to the browser. State can also carry return context that needs protection from tampering. Follow your OAuth library's complete flow rather than removing a parameter on its own.

Confirm you're a person