# GHSA-GF7P-J3HR-H5H4: Feature-flagged resources and prompts remain directly accessible in @frontmcp/plugin-feature-flags

- Database: GitHub
- Severity: CVSS 7.5 (High)
- Published: 2026-09-26
- Modified: 2026-09-26

## Affected versions

- @frontmcp/plugin-feature-flags (npm): from 1.0.0, through 1.7.2

## Description

### Summary

`@frontmcp/plugin-feature-flags` hides disabled resources and prompts from MCP discovery responses but does not enforce the same feature flags when those capabilities are accessed directly.

The plugin correctly filters disabled capabilities from:

```text
tools/list
resources/list
prompts/list
```

and it also contains an execution-time gate for tools.

However, there is no equivalent execution gate for:

```text
resources/read
prompts/get
```

As a result, a client that knows the URI of a disabled resource or the name of a disabled prompt can access it directly even when its feature flag evaluates to `false`.

This was reproduced end-to-end against released `@frontmcp/plugin-feature-flags@1.7.2` and `@frontmcp/sdk@1.7.2`.

In the reproduced configuration:

```text
premium-reports = false
experimental-agent = false
```

the following behavior occurred:

```text
resources/list
    -> premium resource hidden

prompts/list
    -> experimental prompt hidden

resources/read premium resource
    -> full resource returned

prompts/get experimental prompt
    -> full prompt returned

tools/call experimental tool
    -> correctly blocked by the same feature-flag system
```

The server-side resource and prompt handlers executed during the bypass, confirming that this is not merely a metadata or discovery issue.

### Details

The Feature Flags plugin supports feature-gating MCP capabilities through metadata such as:

```ts
featureFlag: 'premium-reports'
```

or:

```ts
featureFlag: 'experimental-agent'
```

For resources, the plugin correctly filters disabled entries from discovery through the resource-list hook.

Conceptually:

```text
resource has featureFlag
    -> flag evaluates false
    -> resources/list removes resource
```

The same behavior exists for prompts and tools.

For tools, the plugin additionally performs an execution-time check before the tool runs.

The relevant design is equivalent to:

```ts
@ToolHook.Will(
    'execute',
    {
        priority: 50
    }
)
async gateToolExecution(
    flowCtx
) {
    const tool =
        flowCtx.state.tool;

    const featureFlag =
        tool?.metadata
            ?.featureFlag;

    if (!featureFlag) {
        return;
    }

    const enabled =
        await this.evaluateFlag(
            featureFlag
        );

    if (!enabled) {
        throw new Error(
            `Tool "${tool.name}" is disabled by feature flag "${featureFlag}"`
        );
    }
}
```

This prevents a client from bypassing `tools/list` filtering simply by invoking a hidden tool directly.

No corresponding enforcement hook exists for resource reads or prompt retrieval.

The resulting resource flow is therefore:

```text
resource metadata:
featureFlag = "premium-reports"

        |
        v

resources/list
        |
        +--> plugin evaluates flag = false
        |
        +--> resource hidden

but:

resources/read
        |
        v

SDK locates resource
        |
        v

normal authority checks
        |
        v

NO feature-flag execution check
        |
        v

resource handler executes
        |
        v

disabled content returned
```

The prompt path has the same issue:

```text
prompt metadata:
featureFlag = "experimental-agent"

        |
        v

prompts/list
        |
        +--> hidden

but:

prompts/get
        |
        v

prompt resolved
        |
        v

NO feature-flag execution check
        |
        v

prompt handler executes
        |
        v

disabled prompt returned
```

The SDK already exposes separate flows for direct resource and prompt access, so discovery filtering alone cannot provide access control.

This is especially significant because the plugin's documented behavior states that disabled capabilities are not only hidden from list responses but also blocked from direct invocation.

### PoC

Install the released packages:

```bash
npm install \
  @frontmcp/sdk@1.7.2 \
  @frontmcp/plugin-feature-flags@1.7.2
```

Configure the Feature Flags plugin with disabled resource and prompt flags:

```js
FeatureFlagPlugin.init({
    adapter:
        'static',

    flags: {
        'beta-search':
            true,

        'experimental-agent':
            false,

        'premium-reports':
            false
    },

    defaultValue:
        false
})
```

Register a resource whose feature flag is disabled:

```js
class PremiumStatusResource
    extends ResourceContext {

    async execute(uri) {
        return {
            contents: [
                {
                    uri:
                        'report://premium-status',

                    mimeType:
                        'text/plain',

                    text:
                        'PREMIUM-SECRET-7f3a'
                }
            ]
        };
    }
}


FrontMcpResource({
    uri:
        'report://premium-status',

    name:
        'Premium Status Report',

    featureFlag:
        'premium-reports'
})(
    PremiumStatusResource
);
```

Register a disabled prompt:

```js
class ExperimentalPrompt
    extends PromptContext {

    async execute() {
        return {
            messages: [
                {
                    role:
                        'user',

                    content: {
                        type:
                            'text',

                        text:
                            'EXPERIMENTAL-PROMPT-TEMPLATE-9c21'
                    }
                }
            ]
        };
    }
}


FrontMcpPrompt({
    name:
        'experimental-analysis',

    description:
        'Experimental analysis prompt',

    featureFlag:
        'experimental-agent'
})(
    ExperimentalPrompt
);
```

Also register a tool using the same disabled flag as a positive control:

```js
FrontMcpTool({
    name:
        'experimental-tool',

    featureFlag:
        'experimental-agent',

    inputSchema: {}
})(
    ExperimentalTool
);
```

Initialize a normal MCP session.

First query discovery.

For:

```text
resources/list
```

the result does not contain:

```text
report://premium-status
```

For:

```text
prompts/list
```

the result does not contain:

```text
experimental-analysis
```

This confirms the feature flags are being evaluated and discovery filtering is active.

Now directly request the hidden resource:

```json
{
  "jsonrpc": "2.0",
  "id": 10,
  "method": "resources/read",
  "params": {
    "uri": "report://premium-status"
  }
}
```

Observed:

```text
HTTP 200
```

with the response containing:

```text
PREMIUM-SECRET-7f3a
```

The resource's server-side handler executed.

Next directly request the hidden prompt:

```json
{
  "jsonrpc": "2.0",
  "id": 11,
  "method": "prompts/get",
  "params": {
    "name": "experimental-analysis"
  }
}
```

Observed:

```text
HTTP 200
```

with the response containing:

```text
EXPERIMENTAL-PROMPT-TEMPLATE-9c21
```

The prompt's server-side handler also executed.

As a positive control, invoke a tool protected by the same disabled feature flag:

```json
{
  "jsonrpc": "2.0",
  "id": 12,
  "method": "tools/call",
  "params": {
    "name": "experimental-tool",
    "arguments": {}
  }
}
```

Observed:

```text
Tool "experimental-tool" is disabled by feature flag "experimental-agent"
```

The reproduced behavior was therefore:

```text
premium-reports = false

resources/list
-> premium resource hidden

resources/read
-> premium resource RETURNED


experimental-agent = false

prompts/list
-> experimental prompt hidden

prompts/get
-> experimental prompt RETURNED


experimental-agent = false

tools/call
-> experimental tool BLOCKED
```

The tool and prompt use the same disabled flag value in the same session, but only the tool has an execution-time gate.

This isolates the vulnerability to missing enforcement on direct resource and prompt access.

### Suggested fix

Feature flags must be enforced at execution time for every gated capability, not only during discovery.

Add resource and prompt execution hooks equivalent to the existing tool gate.

For resources:

```ts
@ResourceHook.Will(
    'execute',
    {
        priority: 50
    }
)
async gateReadResource(
    flowCtx:
        FlowCtxOf<
            'resources:read-resource'
        >
) {
    const resource =
        flowCtx.state.resource;

    if (!resource) {
        return;
    }

    const featureFlag =
        resource.metadata
            ?.featureFlag;

    if (!featureFlag) {
        return;
    }

    const enabled =
        await this.evaluateRef(
            featureFlag
        );

    if (!enabled) {
        throw new Error(
            `Resource "${resource.metadata.name}" is disabled by feature flag`
        );
    }
}
```

For prompts:

```ts
@FlowHooksOf(
    'prompts:get-prompt'
).Will(
    'execute',
    {
        priority: 50
    }
)
async gateGetPrompt(
    flowCtx:
        FlowCtxOf<
            'prompts:get-prompt'
        >
) {
    const prompt =
        flowCtx.state.prompt;

    if (!prompt) {
        return;
    }

    const featureFlag =
        prompt.metadata
            ?.featureFlag;

    if (!featureFlag) {
        return;
    }

    const enabled =
        await this.evaluateRef(
            featureFlag
        );

    if (!enabled) {
        throw new Error(
            `Prompt "${prompt.metadata.name}" is disabled by feature flag`
        );
    }
}
```

The same flag-evaluation helper should be shared by:

```text
discovery filtering
tool execution
resource execution
prompt execution
skill execution
```

so that all capability types have identical semantics.

Regression tests should verify:

```text
disabled tool
    -> hidden from list
    -> direct call blocked

disabled resource
    -> hidden from list
    -> direct read blocked

disabled prompt
    -> hidden from list
    -> direct get blocked

enabled capabilities
    -> list and direct access both succeed
```

Feature flags intended as access controls must always be checked at the execution/read boundary. Discovery filtering should remain only a presentation and discoverability mechanism.

### Impact

A client can directly access resources and prompts that the server operator has disabled for that client through the Feature Flags plugin.

This bypasses the plugin's capability-gating policy while leaving discovery responses appearing correctly restricted.

For feature flags used as entitlement or authorization boundaries, a user whose flag evaluates to `false` can retrieve the full protected resource by knowing its URI.

The demonstrated resource returned protected content even though it was absent from `resources/list`.

Similarly, disabled prompts can be retrieved in full through `prompts/get`, potentially exposing internal prompt templates, unreleased functionality, or other content intentionally restricted by the feature flag.

The failure is particularly misleading because execution-time enforcement works correctly for tools using the same flag state, causing operators to reasonably expect identical behavior for resources and prompts.

## References

- https://github.com/agentfront/frontmcp/security/advisories/GHSA-gf7p-j3hr-h5h4

Page: https://cve.now/GHSA-GF7P-J3HR-H5H4

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