Skip to content

fix(cli): harden OAuth login state validation#137

Merged
dhairyashiil merged 3 commits into
calcom:mainfrom
dhairyashiil:codex/security-cli-oauth
Jul 10, 2026
Merged

fix(cli): harden OAuth login state validation#137
dhairyashiil merged 3 commits into
calcom:mainfrom
dhairyashiil:codex/security-cli-oauth

Conversation

@dhairyashiil

Copy link
Copy Markdown
Member

Summary

Hardens the CLI OAuth login flow by generating a high-entropy state value, requiring the callback state to match before token exchange, and launching the browser with argument-based spawn instead of shell-string execution.

Reviewer notes

  • This only affects packages/cli OAuth login.
  • Please verify the callback URL and scope still match the expected Cal.com OAuth app configuration.
  • This PR adds a local test script for the CLI package so the OAuth regression test is directly runnable.

Validation

  • bun --filter @calcom/cli test -- src/shared/auth.test.ts
  • git diff --check HEAD~1..HEAD

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

@dhairyashiil is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@dhairyashiil dhairyashiil marked this pull request as ready for review July 2, 2026 21:06
@dhairyashiil dhairyashiil enabled auto-merge (squash) July 2, 2026 21:06

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread packages/cli/src/shared/auth.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/cli/package.json Outdated
Comment thread packages/cli/src/shared/auth.test.ts Outdated
Comment thread packages/cli/src/shared/auth.ts Outdated

@bandhan-majumder bandhan-majumder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dhairyashiil dhairyashiil merged commit b79ee6f into calcom:main Jul 10, 2026
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants