Repository navigation
fix(mcp): harden the input of the MCP tools, release 0.13.0 [*] - #26
Merged
Merged
Conversation
…input schemas through one loader [*] The apiConfiguration block was copied into 20 input schema files and two PHP-built form schemas and had drifted. It now lives once in src/Schema/api-configuration.json. InputSchemaLoader resolves the references for the MCP inputSchema, the input validator and the new InputSchemaFileResolver (OpenAPI requestBody, form-schema fallback), so no $ref or $defs reaches a client. No behaviour change: InputSchemaSnapshotTest compares every delivery path byte for byte with fixtures captured from 0.12.1. Part of #18 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… the multipart file name [*] Every id that becomes a segment of an engine path must match ^[A-Za-z0-9][A-Za-z0-9:._-]*$ and is rejected with a 400 before any request is sent, for every caller (HTTP, MCP, CLI, worker). A deployment resource name comes from engine data and may contain "/" or spaces, so only "." and ".." segments are rejected there. Quotes, CR and LF in an uploaded file name are escaped in the Content-Disposition header of the multipart body. Part of #18 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…selector [*]
An explicit apiConfiguration selector must be the first 8 characters or
the full UUID, lowercase. The format is checked before any lookup and
the selector is compared in PHP with the ids of the active "flowable"
configurations, so no wildcard reaches the database. Malformed, unknown,
inactive, other type and an ambiguous prefix all end in the same generic
400 that names no other configuration. This applies to HTTP, MCP, the
--api-configuration option of the console commands and the external
worker. The {uuid} branch of the input schemas carries the same pattern.
BREAKING CHANGE: FlowableClientLocator::__construct() no longer takes a
UuidResolver; partial UUIDs of 9 to 35 characters, uppercase selectors
and inactive configurations are rejected.
Part of #18
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…-input [*] Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…-input [*] Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…pe and size [*]
The six read tools and flowable_dmn_deploy validate their MCP arguments
against the input schema they publish; a tool without a buildable schema
is rejected instead of running unvalidated. HTTP reads are unchanged.
Uploads share one file name rule (no path, no "..", no leading ".", no
quotes or control characters, at most 255 characters) over every
transport. Inline content is limited to 1 MiB per file after decoding,
flowable_deploy_bundle to 20 files and 4 MiB in total.
flowable_dmn_deploy takes only .dmn; .bar and .zip stay with the HTTP
upload. An apiConfiguration value that is neither a string nor
{uuid: string} is rejected instead of selecting implicitly.
Part of #18
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… schema factory [*] A tool whose input file is missing, holds invalid JSON or whose path contains ".." is removed from the resource metadata, so it is neither listed nor callable, with every combination of the switches. The error is logged on the flowable channel. McpToolInputSchemaFactory acts only on the bundle's resources and rejects ".." in the input path. The opis validation of request bodies and MCP tool arguments is one function. Part of #18 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…imits and tool validation [*] Part of #18 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
30 of 35 tasks
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.
Part A of #18: the MCP tools are hardened at their input. Several of the rules sit where all transports meet, so HTTP, the console commands and the external worker are affected too. The CHANGELOG entry
0.13.0lists every observable change.What changes
FlowableClientLocator): an explicitapiConfigurationmust be the first 8 characters or the full UUID, lowercase, of an active configuration of typeflowable. The format is checked before any lookup, the comparison happens in PHP (noLIKE), and malformed, unknown, inactive, other type and an ambiguous prefix all answer the same generic 400. The{uuid}form of the input schemas carries the same pattern.FlowableClient): every id must match^[A-Za-z0-9][A-Za-z0-9:._-]*$and is rejected before any engine request. Deployment resource names are exempt, only.and..segments are rejected there.flowable_deploy_bundle, the file name is escaped inContent-Disposition, inline content is limited to 1 MiB per file, a bundle to 20 files and 4 MiB in total, andflowable_dmn_deploytakes only.dmn(.barand.zipstay with the HTTP upload).flowable_dmn_deployvalidate their MCP arguments against the schema they publish, fail-closed without a buildable schema. HTTP reads are unchanged.McpToolInputSchemaFactoryacts only on the bundle's resources and rejects..in the input path.The first commit is a refactor without behaviour change: the
apiConfigurationschema block lives once insrc/Schema/api-configuration.jsoninstead of 20 copies, and all three loading paths (MCPinputSchema, input validation, OpenAPI and form-schema fallback) go throughInputSchemaLoader.InputSchemaSnapshotTestcompares every delivered schema byte for byte with a snapshot of 0.12.1.Breaking for consumers
FlowableClientLocator::__construct()no longer takes aUuidResolver._or contains non-ASCII letters (id e.g._key:1:5) can no longer be addressed by id; job ids the external worker gets from the engine fall under the rule as well. The rule is not verified against a live engine.itemsPerPageabove 200.Notes
dmstr/api-platform-utils-bundlestays incomposer.json, although the locator no longer uses it; dependencies are not changed in this PR.descriptionof the sharedapiConfigurationdefinition still says "full or partial UUID"; the console upload commands call the client directly and do not apply the file name rule (the header escaping applies).Part of #18
🤖 Generated with Claude Code