Skip to content

Connect with PKCE - #54

Merged
barrykooij merged 1 commit into
devfrom
feat/connect-pkce
Oct 1, 2026
Merged

barrykooij merged 1 commit into
devfrom
feat/connect-pkce

Conversation

@barrykooij

Copy link
Copy Markdown
Member

S2 of the API security review, plugin side: PKCE (RFC 7636, S256) for the connect flow.

  • Starting a connection (connect and reconnect): the plugin generates a 64-character verifier, keeps it per user for 15 minutes next to the state, and adds code_challenge and code_challenge_method=S256 to the connect link.
  • On return: it reads and deletes the verifier (single use, like the state) and sends it as code_verifier in the code exchange. With no stored verifier, it sends none.

The API binds the challenge to the code and only exchanges it with the matching verifier (Scanfully/api#323), so a code that ends up anywhere else is worthless. The dashboard passes the challenge on (Scanfully/dashboard#304).

Compatibility:

  • An older API ignores the extra fields.
  • Against an older dashboard, no challenge reaches the API, and the exchange works as before.

Tests: unit tests for the verifier storage, the RFC 7636 challenge vector, and the exchange body with and without a verifier. composer test (196), phpcs and phpstan pass.

…xchange its verifier, so an authorization code that ends up anywhere else cannot be exchanged for tokens
@barrykooij
barrykooij merged commit 125f7f7 into dev Oct 1, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant