Skip to content

fix(integrations): validate mongodb, neo4j and upstash - #10172

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/validate-databases
Nov 18, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/validate-databases

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Validates the PlanetScale, PostgreSQL, MySQL, SQL Server, Oracle Database, ClickHouse, MongoDB, Neo4j, Redis and Upstash integrations against each vendor's driver docs, server docs and API spec (PlanetScale's OpenAPI spec, Upstash's REST API docs, ClickHouse's HTTP interface and system tables). It also checks the saved-connection wiring from #9929, the host/SSRF guards, and memory-load safety. The PR fixes what was wrong.

  • MongoDB Find/Aggregate and Neo4j statements now read results one at a time instead of buffering them whole. When the serialized rows pass the 10 MiB tool response limit, the run fails with the same PayloadSizeLimitError (same label and limit) that the executor's response-body limit already threw for such results. MongoDB closes the server cursor and Neo4j discards the remaining records, so an oversized result is never loaded in full. A result that fits is returned unchanged, with no row cap. The budget counts the rows array exactly as it serializes (UTF-8 bytes plus brackets and commas) against the full 10 MiB, so it only fails results the response limit already rejected. Neo4j delete only waits for the summary, as before, because its response carries no records.
  • Upstash: key, field and pattern path segments of exactly . or .. are rejected, and integer arguments (EX, EXPIRE seconds, INCRBY increment, LRANGE start/stop) must be integers. URL parsing resolves a dot segment, encoded or not, so HGET .. flushall became a request to /flushall, and an increment such as ../../flushall did the same.
  • Validated with no change: PlanetScale (every endpoint, parameter and response field matches the OpenAPI spec), PostgreSQL, MySQL, SQL Server, Oracle Database, ClickHouse (every system.* column checked against the docs; responses are already byte-capped) and Redis.
  • Compatibility: no block type, subBlock, operation, tool, param or output id changed, and outputs are unchanged. No OAuth scope was added.
  • Left for a product decision: MySQL SSL Mode "Preferred" (the inline block default) refuses a server without TLS, because mysql2 has no prefer mode. The setup guide documents this as deliberate, so a network attacker cannot force an unencrypted connection. Servers without TLS need "Disabled".
  • Left as is: the PostgreSQL and MySQL drivers buffer the whole result before the response limit applies. Streaming them needs postgres.js cursors (no multi-statement scripts, no DML count) or mysql2's text protocol, and either one changes saved workflows. Redis KEYS, HGETALL, LRANGE and the generic command read whatever the server returns, because ioredis has no reply-size limit.

Release notes

MongoDB

  • Find and Aggregate results larger than the 10 MiB tool response limit still fail with the same size error, but now stop reading from the database as soon as the limit is passed instead of loading the whole result first.

Neo4j

  • Query, Execute, Create, Update and Merge results larger than the 10 MiB tool response limit still fail with the same size error, but the remaining records are now discarded on the server instead of loaded into memory. The statement itself still runs in full.

Upstash

  • A key, hash field or pattern of exactly . or .. is now rejected with a clear error. Before, the request could reach a different Redis command (for example, Get Hash Field with key .. and field flushall ran FLUSHALL).
  • Expiration, Increment, Start and Stop must now be integers. A non-integer value is rejected before the request is sent instead of being passed into the request path.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 18, 2026 8:30pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

This PR stops oversized MongoDB and Neo4j results while reading them and adds stricter checks for Upstash request arguments.

  • MongoDB query results stop at the shared response-size limit.
  • Neo4j result streams stop at the shared response-size limit.
  • Upstash Redis tools reject unsafe path segments and non-integer arguments.

No new actionable issues were found.

Reviews (3) · Last reviewed commit: "fix(integrations): drop the row cap; str..." · Reviewed by Greptile

Comment thread apps/sim/lib/internal/mysql/client.ts Resolved

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 53 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/internal/mysql/queries.ts Resolved
Comment thread apps/sim/lib/internal/mysql/client.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 51 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the fix/validate-databases branch from ad60e62 to 603e208 Compare November 18, 2026 18:50
@waleedlatif1
waleedlatif1 force-pushed the fix/validate-databases branch from 603e208 to f8f886e Compare November 18, 2026 19:39
@waleedlatif1 waleedlatif1 changed the title fix(integrations): validate postgresql, mysql, mongodb, neo4j and upstash fix(integrations): validate mongodb, neo4j and upstash Nov 18, 2026
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 24 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the fix/validate-databases branch from af39eaa to 08d75c6 Compare November 18, 2026 20:30
@waleedlatif1
waleedlatif1 merged commit c3748ab into staging Nov 18, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/validate-databases branch November 18, 2026 20:31

This branch was previously deployed

1 inactive deployment
Preview — 08d75c68 Deployed Nov 18, 2026 by vercel[bot]
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