Skip to content

OAuth security hardening & bug fixes from PR review#107

Merged
acrosman merged 2 commits intofeatures/issue-55-oauthfrom
copilot/sub-pr-106
Mar 9, 2026
Merged

OAuth security hardening & bug fixes from PR review#107
acrosman merged 2 commits intofeatures/issue-55-oauthfrom
copilot/sub-pr-106

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

Addresses seven review comments on the OAuth Support PR covering CSRF exposure, insecure server binding, a broken settings save response, and related issues.

Security

  • CSRF state validationcrypto.randomBytes(16).toString('hex') state token is now included in the authorization URL and validated in /callback before code exchange; missing/mismatched state → 400 + response_generic
  • Localhost-only server – OAuth callback server bound to 127.0.0.1 instead of all interfaces; server.on('error', ...) added to handle EADDRINUSE gracefully
  • Navigation lockdownwill-navigate/will-redirect now compare against the exact file://…/app/index.html URL rather than accepting any file:// path

Correctness

  • createConnection guard – throws "Not connected to org: <id>" when the org is absent; all handlers moved to call it inside try/catch with conn?.limitInfo || {} in catch blocks; sf_logout uses delete sfConnections[org] instead of = null
  • sf_save_settings response – was returning the saveSettings() boolean; now returns the saved settings object (minus consumerSecret). render.js updated to skip overwriting the secret field when absent from the response, so the form isn't cleared after a save

Docs & dependencies

  • jest-environment-jsdom downgraded v30 → v29 to match jest v29
  • ReadMe OAuth scope corrected to refresh_token (removes undocumented offline_access)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: acrosman <2972053+acrosman@users.noreply.github.com>
Copilot AI changed the title [WIP] Add OAuth support for login functionality OAuth security hardening & bug fixes from PR review Mar 9, 2026
@acrosman acrosman marked this pull request as ready for review March 9, 2026 17:09
@acrosman acrosman merged commit 9411adc into features/issue-55-oauth Mar 9, 2026
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.

2 participants