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 1f4c436.

@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 2 times, most recently 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

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 24, 2026
@charlesvien
charlesvien force-pushed the fix/veria-351-oauth-token-terminal-leak branch from 992320d to ccf5a68 Compare July 25, 2026 23:50
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 26, 2026
@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 26, 2026
@charlesvien
charlesvien force-pushed the fix/veria-351-oauth-token-terminal-leak branch from ccf5a68 to 1f4c436 Compare July 26, 2026 00:58
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 26, 2026
@stamphog

stamphog Bot commented Jul 26, 2026

Copy link
Copy Markdown

Note

🤖 stamphog reviewed 1f4c4366a643eb222f90ae1583824748125c17aa — verdict: REFUSED

Gates denied this PR (deny-list match on auth-adapter code, tier classified T2-never) and the change touches OAuth token/credential handling in shell environments — security-sensitive surface with no independent human or agent review approving it.

  • 👍 on the PR from greptile-apps[bot].
  • Deny-list gate failed: matches auth-sensitive files (auth-adapter.ts)
  • Tier gate failed: classified T2-never, which requires human review
  • No human or agent review has approved this change (greptile only commented, no approval); a security-sensitive OAuth token change needs a real review before merge
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 @ 9e6e0ca · reviewed head 1f4c436

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 26, 2026
@charlesvien
charlesvien requested a review from a team July 27, 2026 00:24
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