Skip to content

fix(agent-toolkit): close create_form_submission SSRF and remove passwords from WorkForms tools (5.80.4) - #582

Open
shay-alaluf wants to merge 2 commits into
mondaycom:masterfrom
shay-alaluf:fix/workforms-mcp-directory-review-b
Open

shay-alaluf wants to merge 2 commits into
mondaycom:masterfrom
shay-alaluf:fix/workforms-mcp-directory-review-b

Conversation

@shay-alaluf

Copy link
Copy Markdown
Contributor

Stacked on #579 (5.80.3). Until that merges, this PR's diff also shows its commit; the change here is the single commit fix(agent-toolkit): close create_form_submission SSRF....

Problem

An MCP directory review flagged two things in the WorkForms tools:

  • F-11 (SSRF): create_form_submission treated form_token as a short link whenever it contained the text wkf.ms, then sent a HEAD request to the whole value. https://evil.com/wkf.ms or http://169.254.169.254/?wkf.ms made the server request an attacker-chosen address.
  • F-01: passwords must not be typed into an AI chat, but create_form_submission took a password and update_form had a setFormPassword action.

Changes

SSRF (create_form_submission)

  • Input is parsed with new URL() in try/catch; no substring checks.
  • A HEAD request is made only for https://wkf.ms/...: hostname exactly wkf.ms (case-insensitive), no username/password, no explicit port. maxRedirects: 0 kept, 5000 ms timeout added.
  • The Location header is parsed with new URL(location, shortLinkUrl) and never requested. Relative values resolve against the short link.
  • Full URLs on any other host make no request; the token is read from the parsed pathname /forms/<token>.
  • Any resolved token must match ^[A-Za-z0-9_-]+$ (formTokenSchema), otherwise the existing "Could not resolve a WorkForm token" message is returned with no API call. The form_token input type is unchanged (description updated).

Passwords (BREAKING)

  • create_form_submission: password parameter and the $password mutation variable removed. The "not found or not accepting submissions" message now says password-protected forms can't be submitted through this tool and the user should open the form link.
  • update_form: setFormPassword action, formPassword parameter and handler removed, along with the unused mutation and description constants. Turning the password off (features.password.enabled: false) still works; passwordEnabled now says a password is set in the WorkForms UI.
  • GraphQL types regenerated (yarn codegen); the diff only drops the removed pieces.

Behaviour that differs for previously valid input

  • Tokens (bare, from a URL path, or from a Location) with characters outside [A-Za-z0-9_-], e.g. percent-encoded, are now rejected.
  • form_token is trimmed of surrounding whitespace.
  • http://wkf.ms/..., or wkf.ms with a port or credentials, is no longer requested.
  • Full URLs yield a token only when the path starts with /forms/.
  • Callers sending password or setFormPassword now get an invalid-arguments error.

Testing

  • jest on workforms-tools: 3 suites, 136 tests pass. New: rejected hosts/forms (evil.com/wkf.ms, wkf.ms.evil.com, http://169.254.169.254/?wkf.ms, wkf.ms@evil.com, http, port, credentials, ftp, garbage) with no HEAD and no API call; case-insensitive host; relative and unparseable Location; illegal token characters; JSON schemas of both tools have no password/formPassword and no setFormPassword action; disabling the password still works.
  • tsc --noEmit and eslint: clean. prettier --check fails only on create-submission-tool/schema.ts, which already failed on master; no formatting-only changes made.

Not in this PR

features.password.enabled still accepts true in the schema despite the "can only be set to false" description (pre-existing). The MISSING_DESCRIPTION_ALLOWLIST cleanup in platform-mcp-gateway follows the release.

🤖 Generated with Claude Code

…words from WorkForms tools (5.80.4)

- create_form_submission: parse form_token with new URL(); only request https://wkf.ms (exact host, no credentials/port), 5s timeout, Location only parsed, resolved token must match [A-Za-z0-9_-]+
- BREAKING: remove `password` (create_form_submission) and `setFormPassword`/`formPassword` (update_form); disabling the password still works
- regenerate GraphQL types

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@shay-alaluf
shay-alaluf force-pushed the fix/workforms-mcp-directory-review-b branch from d67ba13 to a149874 Compare December 2, 2026 12:10

This branch has not been deployed

No deployments
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.

1 participant