fix: post-merge review follow-ups (path traversal, Sentry PII, Slack instr guard, MCP join rate-limit)#325
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Follow-ups from an aggregated teammate review of 128 PRs merged between 2026-04-09 and 2026-04-23. Five concrete gaps patched: - worker: constrain UploadUserFile to the workspace root (#203 follow-up). path.join allowed `../` and absolute paths to escape the workspace. Now resolves and rejects anything outside workspaceDir when one is set. - core: flip Sentry sendDefaultPii to false (#172 follow-up). User content and identifiers flow through this stack; the schema has no scrubbing so PII-by-default was unsafe. - gateway: make SlackInstructionProvider extend BaseInstructionProvider (#269 follow-up). Sibling Skills/Network providers are wrapped in a try/catch that returns "" on error; Slack was bypassing it and would crash session-context assembly if listConnections threw. - owletto-backend: rate-limit the join_organization MCP tool to match the REST endpoint (#296 follow-up). Keyed on userId since MCP calls don't carry a client IP. Skipped one reviewer finding: removing the process.env fallback for API keys at worker.ts:1099/1109 (the inconsistency with #225 base-URL code). Embedded/dev workers depend on that fallback since credentialStore is only populated from gateway-supplied session context.
Second pass on the 2-week PR review. Five more gaps closed: - gateway: unit tests for verifyOwnedAgentAccess covering owner, cross-tenant, cross-platform, agent-scoped, admin-bypass, unknown-agent, and external OAuth mismatches (#285 follow-up). Closes the test hole in the cross-tenant ownership guard. - owletto-backend: validate each CSP frame-ancestor entry against a strict host-source / scheme-source grammar before joining (#246 follow-up). Malformed env entries like `https:// lobu.ai` are now dropped instead of silently rendered into the directive. - owletto-backend: introduce normalizeHost() in utils/public-origin and use it from getSubdomainZone, extractSubdomainOrg, getCanonicalRedirectUrl, and the BetterAuth trustedOrigins wiring (#234/#224/#214 follow-up). Unifies the ad-hoc .toLowerCase()/.replace() patterns and adds IDN→punycode so `müller.lobu.ai` matches the ASCII zone configured in env. - owletto-backend: redact member emails that surface via template_data and tab template_data in resolve_path, not only on the single resolved entity (#309 follow-up). A dashboard data source that enumerates $member entities no longer leaks emails to non-admin callers. New utils/member-redaction helper plus unit coverage. - owletto-backend: treat #311 as already closed — ToolContext.memberRole is `string | null` (required, not optional), so TypeScript already catches future literal omissions at construction.
e09f1f4 to
96646bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-ups from an aggregated review of 128 PRs merged between 2026-04-09 and 2026-04-23 (7 parallel review agents, grouped by theme). Five concrete gaps patched in one PR.
Fixes
worker— path traversal inUploadUserFile(follow-up to fix(worker): QA hardening for careops agent (Gemini support, UploadUserFile workspace paths, dedup error messages) #203).path.join(workspaceDir, args.file_path)allowed../and absolute paths to escape the workspace. Nowpath.resolves both branches and rejects anything that doesn't land underworkspaceDirwhen one is set. →packages/worker/src/shared/tool-implementations.tscore— SentrysendDefaultPii: true(follow-up to feat(observability): vendor-neutral OTEL tracing + opt-in Sentry #172). User content and identifiers travel through this stack and nobeforeSendscrubber was configured. Flipped tofalse. →packages/core/src/sentry.tsgateway—SlackInstructionProviderbypassedBaseInstructionProvider(follow-up to refactor(gateway): extract BaseInstructionProvider and structured ValidationError #269). SiblingSkills/Networkproviders are wrapped in a try/catch that returns""on error; Slack was implementing the interface directly and would crash session-context assembly iflistConnections()threw. ExportedBaseInstructionProviderand extended it. →packages/gateway/src/connections/slack-instruction-provider.ts,packages/gateway/src/services/instruction-service.tsowletto-backend—join_organizationMCP tool had no rate-limit (follow-up to feat(owletto-backend): public-org read access + self-serve join #296). The RESTPOST /api/:orgSlug/joinendpoint is capped at 10/hour/IP; the MCP tool was unlimited. Added the same cap keyed onuserId(MCP calls don't carry a client IP). →packages/owletto-backend/src/tools/organizations.tsExplicitly skipped
worker.ts:1099/1109process.envfallback for API keys (one reviewer flagged it as inconsistent with fix(gateway,worker): deliver provider base URLs via session context only #225's base-URL change). Kept — embedded/dev workers depend on it sincecredentialStoreis only populated from gateway-supplied session context.@lobu/cli-corenpm deprecation). Better as separate PRs.Test plan
UploadUserFilewith a path containing../../etc/passwdreturns the "outside workspace" error instead of uploading.UploadUserFilewith an absolute path outsideworkspaceDirreturns the error.UploadUserFilewith a normal relative or absolute-inside-workspace path still uploads.SENTRY_DSNunset → no-op.ChatInstanceManager.listConnections()throws insideSlackInstructionProvider, session-context assembly returns an empty instruction string instead of surfacing the error.join_organization11× within an hour yields a rate-limit error on the 11th call.https://claude.ai/code/session_011oAMBGGtHtsYyUdsqHwr51
Generated by Claude Code