Skip to content

fix(security): Keep OAuth token out of terminal environments#3799

Open
charlesvien wants to merge 1 commit into
mainfrom
fix/veria-351-oauth-token-terminal-leak
Open

fix(security): Keep OAuth token out of terminal environments#3799
charlesvien wants to merge 1 commit into
mainfrom
fix/veria-351-oauth-token-terminal-leak

Conversation

@charlesvien

@charlesvien charlesvien commented Jul 24, 2026

Copy link
Copy Markdown
Member

Problem

Resolves VERIA-351: OAuth access token leak in terminal shell environments.

Changes

Stop writing the OAuth token to the shared process env, and scrub the credential vars from the shell/pty env so repo scripts can't read them.

How did you test this?

Unit tests in @posthog/workspace-server (shell env scrubbing, incl. via additionalEnv, and the auth adapter).

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@trunk-io

trunk-io Bot commented Jul 24, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 992320d.

@charlesvien
charlesvien marked this pull request as ready for review July 24, 2026 20:57
@charlesvien charlesvien changed the title keep OAuth token out of terminal environments fix(security): Keep OAuth token out of terminal environments Jul 24, 2026
@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "keep OAuth token out of terminal environ..." | Re-trigger Greptile

@charlesvien
charlesvien force-pushed the fix/veria-351-oauth-token-terminal-leak branch from be02137 to a70ae4d Compare July 24, 2026 21:57
@charlesvien
charlesvien force-pushed the fix/veria-351-oauth-token-terminal-leak branch from a70ae4d to 992320d Compare July 24, 2026 22:01
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 24, 2026
@stamphog

stamphog Bot commented Jul 24, 2026

Copy link
Copy Markdown

Note

🤖 stamphog reviewed 992320de3e567f5301832741110a421f7410dacc — verdict: REFUSED

Gates failed (auth deny-list, T2-never) and the change modifies OAuth token handling and shell credential-env scrubbing — genuinely security-sensitive. The diff looks correct and well-tested, but with no human/agent review beyond a bare reaction, there's no independent assurance to substitute for gate approval.

  • 👍 on the PR from greptile-apps[bot].
  • Gates denied: diff touches auth-sensitive code (token handling in auth-adapter.ts and credential env scrubbing in shell.ts) and was classified as a non-auto-approvable tier.
  • No human or substantive agent review — only a bare Greptile 👍 reaction, no ownership match, no reported author familiarity — so there's no independent assurance for this security-sensitive change.
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list matches: auth
size 18L, 2F substantive, 60L/4F incl. docs/generated/snapshots — within ceiling
tier classified as T2-never: T2-never (60L, 4F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ bf27356 · reviewed head 992320d

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 24, 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.

1 participant