Skip to content

fix(security): Run setup discovery agent in plan mode#3802

Merged
charlesvien merged 1 commit into
mainfrom
fix/veria-356-discovery-bypass-permissions
Jul 26, 2026
Merged

fix(security): Run setup discovery agent in plan mode#3802
charlesvien merged 1 commit into
mainfrom
fix/veria-356-discovery-bypass-permissions

Conversation

@charlesvien

@charlesvien charlesvien commented Jul 24, 2026

Copy link
Copy Markdown
Member

Problem

Resolves VERIA-356: RCE via automated repository setup discovery.

Changes

Run the auto-launched discovery agent in plan mode and deny the interactive tools, so an untrusted repo can't steer it into running write/exec tools or hang it.

How did you test this?

Unit test in @posthog/ui (discovery starts in plan mode with the tools denied, never bypassPermissions).

Automatic notifications

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

@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 3322060.

@charlesvien
charlesvien marked this pull request as ready for review July 24, 2026 20:57
@charlesvien charlesvien changed the title run setup discovery agent in plan mode fix(security): Run setup discovery agent in plan mode Jul 24, 2026
@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "run setup discovery agent in plan mode" | Re-trigger Greptile

Comment thread packages/ui/src/features/setup/setupRunServiceImpl.ts
@veria-ai

veria-ai Bot commented Jul 24, 2026

Copy link
Copy Markdown

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

@charlesvien
charlesvien force-pushed the fix/veria-356-discovery-bypass-permissions branch 2 times, most recently from 8d062fb to cdf2fb6 Compare July 24, 2026 21:38
@charlesvien
charlesvien force-pushed the fix/veria-352-mcp-cache-poisoning branch 2 times, most recently from cfc8cd8 to f9ddf14 Compare July 24, 2026 21:57
@charlesvien
charlesvien force-pushed the fix/veria-356-discovery-bypass-permissions branch from cdf2fb6 to e4b0af0 Compare July 24, 2026 21:57
@charlesvien
charlesvien force-pushed the fix/veria-352-mcp-cache-poisoning branch from f9ddf14 to 65696c3 Compare July 24, 2026 22:01
@charlesvien
charlesvien force-pushed the fix/veria-356-discovery-bypass-permissions branch from e4b0af0 to 4b5fb9e 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
github-actions[bot]
github-actions Bot previously approved these changes Jul 24, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Security-sensitive fix restricting the auto-launched discovery agent's permissions; the one critical concern raised by the security bot (repo-controlled settingSources letting committed hooks execute) is directly fixed in this diff (settingSources: ["user"] for the discovery run, threaded through the schema and options builder) and covered by a new unit test, with the security bot's inline comment marked resolved and a follow-up confirming all issues addressed at 0/10 risk.

  • Author wrote 0% of the modified lines and has 41 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 22L, 4F substantive, 62L/5F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1b-small (62L, 5F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ bf27356 · reviewed head 4b5fb9e

@charlesvien
charlesvien force-pushed the fix/veria-352-mcp-cache-poisoning branch from 65696c3 to 5dadd74 Compare July 25, 2026 23:50
@charlesvien
charlesvien force-pushed the fix/veria-356-discovery-bypass-permissions branch from 4b5fb9e to 3322060 Compare July 25, 2026 23:50
@charlesvien
charlesvien changed the base branch from fix/veria-352-mcp-cache-poisoning to main July 25, 2026 23:50
@trunk-io

trunk-io Bot commented Jul 25, 2026

Copy link
Copy Markdown

😎 This pull request was merged.

@stamphog
stamphog Bot dismissed github-actions[bot]’s stale review July 25, 2026 23:51

New commits pushed (delta classified non_linear_history) — stamphog approval dismissed; re-review running automatically.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Security-sensitive change (agent auto-launch permissions), but the diff shows the exact fix for the veria-ai bot's flagged critical issue — settingSources is now restricted to "user" only, excluding repo-controlled project/local hooks — and the bot's follow-up comment confirms no open concerns remain (0/10 risk). That's independent security-reviewer assurance covering the risky part, with a matching unit test.

  • Author wrote 0% of the modified lines and has 41 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 22L, 4F substantive, 62L/5F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1b-small (62L, 5F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ bf27356 · reviewed head 3322060

@charlesvien
charlesvien merged commit fb3d69e into main Jul 26, 2026
28 of 29 checks passed
@charlesvien
charlesvien deleted the fix/veria-356-discovery-bypass-permissions branch July 26, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant