Skip to content

feat: enhance sandbox boundary checks to prevent access to internal constructors and ensure plain JSON serialization of tool schemas - #512

Merged
frontegg-david merged 9 commits into
release/1.5.xfrom
security-enhancements
Jul 26, 2026
Merged

feat: enhance sandbox boundary checks to prevent access to internal constructors and ensure plain JSON serialization of tool schemas#512
frontegg-david merged 9 commits into
release/1.5.xfrom
security-enhancements

Conversation

@frontegg-david

@frontegg-david frontegg-david commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Security

    • Hardened sandbox boundary to block escape attempts and prevent discovery of meta-tools/tool internals.
    • Tool inputs and results are projected into safe plain JSON across the boundary; unsupported/circular data is rejected as tool errors.
    • Installation now rejects unsafe manifest plugin names and bundle paths, and avoids symlink traversal/out-of-bounds copies.
  • Documentation

    • Updated getTool docs to reflect new schema shapes (inputSchema/outputSchema as plain JSON Schema or null) and clearer undefined cases.
  • Bug Fixes

    • Improved isolation/normalization for multi-content results and schema data.

github-actions Bot and others added 3 commits July 21, 2026 13:47
…ge.json and yarn.lock (#509)

Cherry-picked from #508 (merged to release/1.5.x)
Original commit: 82f5351

Co-authored-by: agentfront[bot] <agentfront[bot]@users.noreply.github.com>
Co-authored-by: frontegg-david <69419539+frontegg-david@users.noreply.github.com>
… internal addresses by default and allow configuration for trusted environments (#511)

Cherry-picked from #510 (merged to release/1.5.x)
Original commit: 077201e

Co-authored-by: agentfront[bot] <agentfront[bot]@users.noreply.github.com>
Co-authored-by: frontegg-david <69419539+frontegg-david@users.noreply.github.com>
…onstructors and ensure plain JSON serialization of tool schemas
Copilot AI review requested due to automatic review settings July 25, 2026 19:05
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 46629fd6-c1b5-41cd-a638-dcd13b9a8f80

📥 Commits

Reviewing files that changed from the base of the PR and between 0ed18c1 and 271e3a1.

📒 Files selected for processing (2)
  • libs/cli/src/commands/package/__tests__/install.spec.ts
  • libs/cli/src/commands/package/install.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • libs/cli/src/commands/package/install.ts
  • libs/cli/src/commands/package/tests/install.spec.ts

📝 Walkthrough

Walkthrough

The PR hardens CodeCall and enclave sandbox boundaries, sanitizes tool metadata and MCP results, validates package installation paths and names, adds security and behavior tests, updates documentation and public schema types, and upgrades enclave-related dependencies.

Changes

CodeCall boundary hardening

Layer / File(s) Summary
Plain-data projection and tool metadata
plugins/plugin-codecall/src/..., docs/frontmcp/plugins/codecall/agentscript.mdx
Tool schemas and complex MCP content are projected into plain JSON data, self-referential tools are hidden, and the getTool contract documents nullable JSON schemas and undefined cases.
CodeCall projection and visibility tests
plugins/plugin-codecall/src/__tests__/*
Tests cover schema accessors, cloning, prototype removal, cyclic values, allowlists, meta-tool hiding, and isolated MCP content.
Sandbox boundary E2E coverage
apps/e2e/demo-e2e-codecall/e2e/codecall.e2e.spec.ts
E2E tests cover inert schemas, blocked constructor escapes, hidden meta-tools, and illegal sandbox access.

Enclave output serialization

Layer / File(s) Summary
Sandbox value serialization
libs/sdk/src/job/enclave/job-enclave.bridge.ts, package.json, libs/sdk/package.json, libs/utils/package.json
Sandbox inputs and tool results use structured cloning, with boundary errors converted into tool errors; enclave dependencies are updated to 2.15.1.
Enclave serialization tests
libs/sdk/src/job/enclave/__tests__/job-enclave.bridge.spec.ts
Tests verify cloning, structured values, prototype stripping, disposal, and rejection of unsupported values.

Package installation validation

Layer / File(s) Summary
Install path validation
libs/cli/src/commands/package/install.ts
Installation validates plugin names and contained bundle paths, resolves symlinks, and copies only contained regular files.
Installation behavior coverage
libs/cli/src/commands/package/__tests__/install.spec.ts
Tests cover installation, source routing, manifest discovery, symlink behavior, post-copy setup, storage, environment generation, and registry ports.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers: alexmercerpo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main security-focused changes: sandbox boundary hardening and plain JSON tool schema serialization.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 65.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security-enhancements

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

Pull request overview

This PR tightens sandbox boundary handling and tool introspection in the CodeCall plugin by ensuring only plain, inert data crosses into scripts (not live schema objects or other host-bound structures), and adds CLI install hardening against path/name injection.

Changes:

  • Introduces a toPlainJson helper and uses it to sanitize complex MCP tool results and tool schema metadata exposed to the sandbox.
  • Blocks CodeCall meta-tool introspection via getTool and projects tool schemas via JSON Schema accessors (getInputJsonSchema / getOutputJsonSchema).
  • Adds sandbox bridge cloning for callTool/getTool results and hardens frontmcp install with plugin name + bundle path validation, with expanded unit/e2e coverage.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
plugins/plugin-codecall/src/utils/plain-json.ts Adds JSON round-trip helper for producing plain JSON-safe data.
plugins/plugin-codecall/src/utils/mcp-result.ts Sanitizes complex CallToolResult.content via toPlainJson.
plugins/plugin-codecall/src/utils/index.ts Exposes toPlainJson from the utils barrel.
plugins/plugin-codecall/src/tools/execute.tool.ts Prevents introspection of CodeCall tools and returns plain JSON tool schema projections.
plugins/plugin-codecall/src/README.md Updates script-facing getTool typings for JSON Schema documents.
plugins/plugin-codecall/src/codecall.symbol.ts Updates VM environment contract to expose JSON Schema objects (or null).
plugins/plugin-codecall/src/tests/plain-json.spec.ts Adds unit tests for toPlainJson.
plugins/plugin-codecall/src/tests/mcp-result.spec.ts Adds tests for multi-content isolation + plain-data projection.
plugins/plugin-codecall/src/tests/execute.tool.spec.ts Updates tests for schema projection, null schemas, and self-reference blocking.
libs/sdk/src/job/enclave/job-enclave.bridge.ts Clones callTool/getTool results before handing them to the sandbox.
libs/sdk/src/job/enclave/tests/job-enclave.bridge.spec.ts Adds tests verifying sandbox receives copied/plain values and rejects non-serializable results.
libs/cli/src/commands/package/install.ts Validates plugin name and bundle path containment during install; adds containment check to copies.
libs/cli/src/commands/package/tests/install.spec.ts Adds install security regression tests for name/bundle path traversal.
apps/e2e/demo-e2e-codecall/e2e/codecall.e2e.spec.ts Adds E2E coverage for schema inertness and constructor-escape blocking.
Comments suppressed due to low confidence (1)

libs/cli/src/commands/package/install.ts:193

  • copyIfExists can accept nested relative paths (since isPluginContainedPath allows them), but it doesn't create destination subdirectories. If manifestData.bundle (or any copied filename) contains a path segment like dist/bundle.js, fs.copyFileSync will throw ENOENT.
  const src = path.join(fromDir, filename);
  if (fs.existsSync(src)) {
    fs.copyFileSync(src, path.join(toDir, filename));
  }
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/plugin-codecall/src/utils/plain-json.ts Outdated
Comment thread plugins/plugin-codecall/src/__tests__/plain-json.spec.ts Outdated

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
plugins/plugin-codecall/src/tools/execute.tool.ts (1)

156-176: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

getTool ignores the allowedTools whitelist.

The new guard closes self-reference introspection, but allowedToolSet (line 69) is still only consulted in callTool (line 88). A script constrained to allowedTools: ['users:list'] can still enumerate the full name/description/schema of every registered tool via getTool. If the whitelist is meant as a capability boundary and not just a call filter, apply it here too.

🔒 Proposed alignment of introspection with the call whitelist
           if (isBlockedSelfReference(name)) return undefined;
 
           const tools = this.scope.tools.getTools(true);
           const tool = tools.find((t) => t.name === name || t.fullName === name);
 
           if (!tool) return undefined;
+          if (allowedToolSet && !allowedToolSet.has(tool.name) && !allowedToolSet.has(tool.fullName)) {
+            return undefined;
+          }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/plugin-codecall/src/tools/execute.tool.ts` around lines 156 - 176,
Update getTool to enforce the existing allowedToolSet whitelist before resolving
and returning tool metadata, using the same tool-name matching semantics as
callTool. Return undefined for tools outside the whitelist while preserving the
self-reference guard and existing introspection behavior for allowed tools.
🧹 Nitpick comments (2)
apps/e2e/demo-e2e-codecall/e2e/codecall.e2e.spec.ts (1)

449-451: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Tighten these security assertions to exact values.

not.toBe('object') / not.toBe('function') pass for any unexpected type, so a regression that leaks internals as some other shape would go undetected. Since the projection is plain JSON, both should be exactly 'undefined'.

♻️ Proposed assertion tightening
-      expect(execResult.result.internal).not.toBe('object');
-      expect(execResult.result.parse).not.toBe('function');
+      expect(execResult.result.internal).toBe('undefined');
+      expect(execResult.result.parse).toBe('undefined');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/e2e/demo-e2e-codecall/e2e/codecall.e2e.spec.ts` around lines 449 - 451,
Update the security assertions in the schema projection test to require exact
undefined results: change the checks for execResult.result.internal and
execResult.result.parse to assert the string value 'undefined', preserving the
existing coverage of inaccessible internals and methods.
libs/cli/src/commands/package/__tests__/install.spec.ts (1)

24-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

runCmd mock implementation leaks across tests.

runCmd is a single shared jest.fn() (module-level mock). beforeEach uses clearAllMocks(), which clears call history but not implementations set via mockImplementation. The mockImplementation set in "builds from frontmcp.config.js…" (Lines 169-171) therefore persists into later tests like "installs declared native addons" (Lines 196-213), silently writing an extra manifest into that test's packageDir/dist when runCmd is invoked for npm init/npm install. No current assertion fails, but this is a test-isolation smell that risks flaky/confusing failures as tests evolve.

♻️ Proposed fix
-jest.clearAllMocks();
+jest.resetAllMocks();

(Note: resetAllMocks() removes implementations too, so mocks configured in module factories like runQuestionnaire/fetchFromNpm would need re-establishing per test, or scope the reset to runCmd only, e.g. (runCmd as jest.Mock).mockReset(); in beforeEach.)

Also applies to: 169-172, 196-213

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/cli/src/commands/package/__tests__/install.spec.ts` around lines 24 -
26, Reset the runCmd mock implementation between tests, not just its call
history, so the mock configured in the “builds from frontmcp.config.js…” test
cannot affect later tests such as “installs declared native addons.” Update the
relevant beforeEach setup to reset only runCmd (for example via its mockReset
behavior), while preserving the module-factory implementations for
runQuestionnaire and fetchFromNpm.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/sdk/src/job/enclave/job-enclave.bridge.ts`:
- Line 118: In libs/sdk/src/job/enclave/job-enclave.bridge.ts at lines 118-118
and 127-127, capture context.callTool and context.getTool in local const
references before creating the sandbox closures, then invoke those captured
callbacks instead of re-reading the possibly mutated context properties; update
both affected call sites consistently.

In `@plugins/plugin-codecall/src/__tests__/execute.tool.spec.ts`:
- Around line 764-784: Rename the test case describing the legacy tool behavior
so its title reflects that getTool returns an object with null input and output
schemas, rather than saying it returns undefined. Keep the test setup and
assertions unchanged.

In `@plugins/plugin-codecall/src/__tests__/plain-json.spec.ts`:
- Around line 43-56: Rename the test case around toPlainJson to describe the
circular, unrepresentable pinned property scenario rather than flattening into
ordinary data. Keep the existing assertions and setup unchanged, since the
acyclic flattening behavior is covered separately.

In `@plugins/plugin-codecall/src/README.md`:
- Around line 673-678: Update the documented getTool declaration to allow an
undefined return value and make description optional, matching
CodeCallVmEnvironment’s schema contract. Review and update the mirrored
documentation under docs/frontmcp/plugins/** so all references consistently
describe the same behavior for meta-tools, unknown tools, and unprojectable
schemas.

---

Outside diff comments:
In `@plugins/plugin-codecall/src/tools/execute.tool.ts`:
- Around line 156-176: Update getTool to enforce the existing allowedToolSet
whitelist before resolving and returning tool metadata, using the same tool-name
matching semantics as callTool. Return undefined for tools outside the whitelist
while preserving the self-reference guard and existing introspection behavior
for allowed tools.

---

Nitpick comments:
In `@apps/e2e/demo-e2e-codecall/e2e/codecall.e2e.spec.ts`:
- Around line 449-451: Update the security assertions in the schema projection
test to require exact undefined results: change the checks for
execResult.result.internal and execResult.result.parse to assert the string
value 'undefined', preserving the existing coverage of inaccessible internals
and methods.

In `@libs/cli/src/commands/package/__tests__/install.spec.ts`:
- Around line 24-26: Reset the runCmd mock implementation between tests, not
just its call history, so the mock configured in the “builds from
frontmcp.config.js…” test cannot affect later tests such as “installs declared
native addons.” Update the relevant beforeEach setup to reset only runCmd (for
example via its mockReset behavior), while preserving the module-factory
implementations for runQuestionnaire and fetchFromNpm.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2f61786b-3ef1-478e-884b-5abccd34d12c

📥 Commits

Reviewing files that changed from the base of the PR and between a307c49 and 938afb3.

📒 Files selected for processing (14)
  • apps/e2e/demo-e2e-codecall/e2e/codecall.e2e.spec.ts
  • libs/cli/src/commands/package/__tests__/install.spec.ts
  • libs/cli/src/commands/package/install.ts
  • libs/sdk/src/job/enclave/__tests__/job-enclave.bridge.spec.ts
  • libs/sdk/src/job/enclave/job-enclave.bridge.ts
  • plugins/plugin-codecall/src/README.md
  • plugins/plugin-codecall/src/__tests__/execute.tool.spec.ts
  • plugins/plugin-codecall/src/__tests__/mcp-result.spec.ts
  • plugins/plugin-codecall/src/__tests__/plain-json.spec.ts
  • plugins/plugin-codecall/src/codecall.symbol.ts
  • plugins/plugin-codecall/src/tools/execute.tool.ts
  • plugins/plugin-codecall/src/utils/index.ts
  • plugins/plugin-codecall/src/utils/mcp-result.ts
  • plugins/plugin-codecall/src/utils/plain-json.ts

Comment thread libs/sdk/src/job/enclave/job-enclave.bridge.ts Outdated
Comment thread plugins/plugin-codecall/src/__tests__/execute.tool.spec.ts Outdated
Comment thread plugins/plugin-codecall/src/__tests__/plain-json.spec.ts Outdated
Comment thread plugins/plugin-codecall/src/README.md Outdated
@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Performance Test Results

Status: ✅ All tests passed

Summary

Project Tests Passed Warnings Failed Leaks
✅ demo-e2e-agents 4 4 0 0 0
✅ demo-e2e-cache 11 11 0 0 0
✅ demo-e2e-codecall 4 4 0 0 0
✅ demo-e2e-config 4 4 0 0 0
✅ demo-e2e-direct 3 3 0 0 0
✅ demo-e2e-elicitation 1 1 0 0 0
✅ demo-e2e-errors 4 4 0 0 0
✅ demo-e2e-hooks 3 3 0 0 0
✅ demo-e2e-multiapp 4 4 0 0 0
✅ demo-e2e-notifications 3 3 0 0 0
✅ demo-e2e-openapi 2 2 0 0 0
✅ demo-e2e-providers 4 4 0 0 0
✅ demo-e2e-public 4 4 0 0 0
✅ demo-e2e-redis 15 15 0 0 0
✅ demo-e2e-remember 4 4 0 0 0
✅ demo-e2e-remote 5 5 0 0 0
✅ demo-e2e-serverless 2 2 0 0 0
✅ demo-e2e-skills 15 15 0 0 0

Total: 92 tests across 18 projects

📊 View full report in workflow run


Generated at: 2026-07-26T02:07:29.474Z
Commit: f4d638fa

…e the allowedTools whitelist and improve plain JSON schema handling
Copilot AI review requested due to automatic review settings July 25, 2026 20:03

Copilot AI 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.

Pull request overview

Copilot reviewed 39 out of 40 changed files in this pull request and generated 2 comments.

Comment thread plugins/plugin-codecall/src/codecall.symbol.ts
Comment thread libs/testing/package.json Outdated

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/frontmcp/plugins/codecall/agentscript.mdx`:
- Around line 73-77: Update the getTool example so the returned meta value is
checked for undefined before accessing description or inputSchema. Follow the
existing documented guard pattern and ensure the example uses the library’s
public API surface while preserving the shown metadata output for a found tool.

In `@libs/testing/package.json`:
- Around line 95-97: Update the `@frontmcp/sdk` dependency entry in the package
manifest from 1.4.0 to the exact 1.5.2 release-line version, matching the
adjacent internal `@frontmcp` dependencies.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c01abf78-c6de-45eb-9f0d-167248326989

📥 Commits

Reviewing files that changed from the base of the PR and between 938afb3 and f1a2f31.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (34)
  • apps/e2e/demo-e2e-codecall/e2e/codecall.e2e.spec.ts
  • docs/frontmcp/plugins/codecall/agentscript.mdx
  • libs/adapters/package.json
  • libs/auth/package.json
  • libs/cli/package.json
  • libs/cli/src/commands/package/__tests__/install.spec.ts
  • libs/di/package.json
  • libs/edge/package.json
  • libs/guard/package.json
  • libs/lazy-zod/package.json
  • libs/nx-plugin/package.json
  • libs/observability/package.json
  • libs/plugins/package.json
  • libs/protocol/package.json
  • libs/react/package.json
  • libs/sdk/src/job/enclave/job-enclave.bridge.ts
  • libs/skills/package.json
  • libs/storage-sqlite/package.json
  • libs/testing/package.json
  • libs/ui/package.json
  • libs/uipack/package.json
  • libs/utils/package.json
  • plugins/plugin-approval/package.json
  • plugins/plugin-cache/package.json
  • plugins/plugin-codecall/src/README.md
  • plugins/plugin-codecall/src/__tests__/execute.tool.spec.ts
  • plugins/plugin-codecall/src/__tests__/plain-json.spec.ts
  • plugins/plugin-codecall/src/codecall.symbol.ts
  • plugins/plugin-codecall/src/tools/execute.tool.ts
  • plugins/plugin-codecall/src/utils/plain-json.ts
  • plugins/plugin-dashboard/package.json
  • plugins/plugin-feature-flags/package.json
  • plugins/plugin-remember/package.json
  • plugins/plugin-skilled-openapi/package.json
🚧 Files skipped from review as they are similar to previous changes (9)
  • plugins/plugin-codecall/src/utils/plain-json.ts
  • plugins/plugin-codecall/src/codecall.symbol.ts
  • libs/sdk/src/job/enclave/job-enclave.bridge.ts
  • apps/e2e/demo-e2e-codecall/e2e/codecall.e2e.spec.ts
  • plugins/plugin-codecall/src/tools/execute.tool.ts
  • plugins/plugin-codecall/src/README.md
  • libs/cli/src/commands/package/tests/install.spec.ts
  • plugins/plugin-codecall/src/tests/execute.tool.spec.ts
  • plugins/plugin-codecall/src/tests/plain-json.spec.ts

Comment thread docs/frontmcp/plugins/codecall/agentscript.mdx
Comment thread libs/testing/package.json Outdated
Copilot AI review requested due to automatic review settings July 26, 2026 00:56

Copilot AI 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.

Pull request overview

Copilot reviewed 42 out of 43 changed files in this pull request and generated 3 comments.

Comment thread libs/cli/src/commands/package/install.ts Outdated
Comment thread plugins/plugin-codecall/src/utils/mcp-result.ts Outdated
Comment thread libs/sdk/src/job/enclave/job-enclave.bridge.ts
Copilot AI review requested due to automatic review settings July 26, 2026 01:08

Copilot AI 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.

Pull request overview

Copilot reviewed 42 out of 43 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

libs/cli/src/commands/package/install.ts:193

  • copyIfExists() now silently returns for unsafe relative paths and silently skips missing files. Since it’s used to copy required install artifacts (bundle, manifest, runner), this can lead to a “successful” install that registers an app with missing files. It also doesn’t create parent directories for nested bundle paths. Consider failing fast on unsafe/missing inputs and ensuring the destination directory exists.
function copyIfExists(fromDir: string, toDir: string, filename: string): void {
  if (!isPluginContainedPath(toDir, filename)) return;

  const src = path.join(fromDir, filename);
  if (fs.existsSync(src)) {
    fs.copyFileSync(src, path.join(toDir, filename));
  }
}

Comment thread libs/sdk/src/job/enclave/job-enclave.bridge.ts
@frontegg-david
frontegg-david changed the base branch from main to release/1.5.x July 26, 2026 01:27

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/cli/src/commands/package/install.ts`:
- Around line 192-213: Update resolveContainedFile and copyIfExists to use the
matching filesystem helpers exported by `@frontmcp/utils` instead of direct
node:fs calls, including realpath, stat, directory creation, and file copying;
preserve the existing containment checks and null/early-return behavior.
- Around line 205-213: Update copyIfExists and its installation-directory setup
so the destination parent is resolved and validated after recursive directory
creation, before fs.copyFileSync writes. Reject an existing symlinked installDir
or parent rather than traversing it, while preserving the existing
contained-path and source checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9acf51af-0918-46bd-af31-844e7ba8375b

📥 Commits

Reviewing files that changed from the base of the PR and between 8371681 and 0ed18c1.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • libs/cli/src/commands/package/__tests__/install.spec.ts
  • libs/cli/src/commands/package/install.ts
  • libs/sdk/package.json
  • libs/sdk/src/job/enclave/__tests__/job-enclave.bridge.spec.ts
  • libs/sdk/src/job/enclave/job-enclave.bridge.ts
  • libs/utils/package.json
  • plugins/plugin-codecall/package.json
  • plugins/plugin-codecall/src/utils/mcp-result.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • libs/sdk/package.json
  • plugins/plugin-codecall/package.json
  • plugins/plugin-codecall/src/utils/mcp-result.ts
  • libs/sdk/src/job/enclave/tests/job-enclave.bridge.spec.ts

Comment thread libs/cli/src/commands/package/install.ts Outdated
Comment thread libs/cli/src/commands/package/install.ts Outdated
@frontegg-david
frontegg-david merged commit 209cddd into release/1.5.x Jul 26, 2026
16 of 17 checks passed
@frontegg-david
frontegg-david deleted the security-enhancements branch July 26, 2026 02:03
@github-actions

Copy link
Copy Markdown
Contributor

Cherry-pick Conflict

Automatic cherry-pick to main failed due to merge conflicts.

An issue has been created with manual instructions. Please resolve if this change should also be in main.

frontegg-david added a commit that referenced this pull request Jul 26, 2026
…onstructors and ensure plain JSON serialization of tool schemas (#512) (#514)

* Cherry-pick: chore: update mcp-from-openapi to version 2.5.1 in package.json and yarn.lock (#509)

Cherry-picked from #508 (merged to release/1.5.x)
Original commit: 82f5351




* Cherry-pick: fix: enhance SSRF protection in OpenAPI polling to block internal addresses by default and allow configuration for trusted environments (#511)

Cherry-picked from #510 (merged to release/1.5.x)
Original commit: 077201e




* feat: enhance sandbox boundary checks to prevent access to internal constructors and ensure plain JSON serialization of tool schemas

* feat: enhance tool introspection to return undefined for tools outside the allowedTools whitelist and improve plain JSON schema handling

* feat: update tool description retrieval to handle undefined cases and improve schema handling

* feat: update tool description retrieval to handle undefined cases and improve schema handling

* feat: update tool description retrieval to handle undefined cases and improve schema handling

* feat: update tool description retrieval to handle undefined cases and improve schema handling

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: agentfront[bot] <agentfront[bot]@users.noreply.github.com>
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.

3 participants