CVE-2025-59333: @executeautomation/database server @executeautomation/database-server Does Not Properly Restrict Vulnerability

HIGH
Advisory Identifier: GHSA-65hm-pwj5-73pw
CVSS 8.1
CWE-284
Published
Advisory Summary

CVE-2025-59333 is a HIGH (CVSS 8.1) @executeautomation/database-server does not properly restrict vulnerability (CWE-284: Improper Access Control) affecting @executeautomation/database server libraries in the npm ecosystem. The issue involves @executeautomation/database-server does not properly restrict access, bypassing a "read-only" mode. Remediation is available in the latest vendor maintenance releases.

CVE-2025-59333 at a Glance

CVE Identifier CVE-2025-59333
GHSA Identifier GHSA-65hm-pwj5-73pw
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-284: Improper Access Control
Affected Product @executeautomation/database server
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2025-59333

To remediate this vulnerability, upgrade all affected @executeautomation/database server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@executeautomation/database-server fixed: Latest secure release
npm install @executeautomation/database-server@Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @executeautomation/database-server

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-59333, inspect your project dependencies using npm:

npm ls @executeautomation/database-server

Analyze the terminal output to locate any version of @executeautomation/database server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The npm ls @executeautomation/database-server command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In @executeautomation/database server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The MCP Server provided by ExecuteAutomation at https://github.com/executeautomation/mcp-database-server provides an MCP interface for agentic workflows to interact with different kinds of database servers such as PostgreSQL database. However, the `mcp-database-server` MCP Server distributed via the npm package `@executeautomation/database-server` fails to implement proper security control that properly enforce a "read-only" mode and as such it is vulnerable to abuse and attacks on the affected database servers such as PostgreSQL (and potentially other db servers that expose elevated functionalities) and which may result in denial of service and other unexpected behavior. This MCP Server is also publicly published in the npm registry: https://www.npmjs.com/package/@executeautomation/database-server ## Vulnerable code The vulnerable code to SQL injection takes shape in several ways: - `startsWith("SELECT")` can include multiple queries because the pg driver for the `client.query()` supports multi queries if terminated with a `;` - `startsWith("SELECT")` can include denial of service queries for stored procedures and other internal db functions The tool call [here in index.ts](https://github.com/executeautomation/mcp-database-server/blob/d6afa4be08eb05343195635fa9462746a6be3a59/index.ts#L272C1-L291C6) is vulnerable: ``` // Handle tool calls server.setRequestHandler(CallToolRequestSchema, async (request) => { switch (request.params.name) { case "read_query": { const query = request.params.arguments?.query as string; if (!query.trim().toLowerCase().startsWith("select")) { throw new Error("Only SELECT queries are allowed with read_query"); } try { const result = await dbAll(query); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], isError: false, }; } catch (error: any) { throw new Error(`SQL Error: ${error.message}`); } } ``` The MCP Server exposes the tool `read_query` with a naive attempt to guard for exclusive "read-only" mode that allows only data retrieval from the server by performing a check on the provided query string to ensure that it starts with a "SELECT" query. In short, the code check `startWith("select")` is not an adequate security control to strict for read-only mode queries and can be abused for side-effects and database-level operations. ## Exploitation While allowing only `SELECT` type queries might seem like a good defense to allow only data retrieval and not data manipulation in any way (hence, "read-only" mode), it is a non-suficient way of protecting against database servers that expose extra functionality through internal function calls. Several examples that will allow side effects through `SELECT` queries: 1. Stored procedures: `SELECT some_function_that_updates_data();` 2. Internal database administrative operations: `SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE ...;` Even when the database is known not to have any stored procedures defined, an attacker can still cause significant availability and service disruption by executing `pg_terminate_backend()`. Following is a reproduction: - Simulate a long-running query, for example: `query = "SELECT pg_sleep(5 * 60)"` - Now, from the MCP programmatic interface, execute the following query `SELECT pid, usename, state, query FROM pg_stat_activity;` to get the PID for the long running query - Next, use the same MCP interface to then request to run the following query: `SELECT pg_terminate_backend(PID);` and observe the long running query is now terminated Similar database side-effects may be found in MySQL or SQLite. ## Impact The above exploitation surfaces two significant security risks: a denial of service that affects availability and confidentiality dislcosure that allows users unauthorized access to queries running on the server and potential leak of data. ## Recommendation - Don't rely solely on the "starts with" `SELECT` - Strict access to specific tables that the user is only authorized to query for - Do not allow multiple SQL queries to be chained together like `SELECT * ...; INSERT INTO ...` - Require users that adopt this MCP Server to use fine-grained permissions on the database server with strict and explicit access to specific capabilities on the server. ## CVE Details Recommended CWE: CWE-284: Improper Access Control Recommendec CVSS: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H ## References and Prior work 1. GitHub Kanban MCP Server found [vulnerable to command injection](https://github.com/advisories/GHSA-6jx8-rcjx-vmwf). 2. iOS Simulator MCP Server found [vulnerable to command injection](https://github.com/advisories/GHSA-6f6r-m9pv-67jw). 3. Liran's [Node.js Secure Coding](https://www.nodejs-security.com/book/command-injection) for educational materials on injection attacks and secure coding practices. 4. [How to Bypass Access Control in PostgreSQL in Simple PSQL MCP Server for SQL Injection](https://www.nodejs-security.com/blog/how-to-bypass-access-control-in-postgresql-in-simple-psql-mcp-server-for-sql-injection) 5. Reference example from prior security research on this topic, demonstrating how vulnerable MCP Server connected to Cursor is abused with prompt injection to bypass the developer's intended logic: ![Cursor defined MCP Server vulnerable to command injection](https://res.cloudinary.com/snyk/image/upload/f_auto,w_2560,q_auto/v1747081395/Screenshot_2025-05-07_at_9.22.11_AM_d76kvm.png) ## Credit Disclosed by [Liran Tal](https://lirantal.com)

CVE-2025-59333 Affected @executeautomation/database server Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
@executeautomation/database-server
npm
≤ 1.1.0

References

Frequently Asked Questions

What is CVE-2025-59333?
CVE-2025-59333 is a security vulnerability in @executeautomation/database server involving @executeautomation/database-server does not properly restrict access, bypassing a "read-only" mode under CWE-284: Improper Access Control.
Which @executeautomation/database server versions are affected?
Affected versions include releases prior to current release patches across affected packages: @executeautomation/database-server.
What version fixes CVE-2025-59333?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is @executeautomation/database-server affected?
Yes, @executeautomation/database-server is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2025-59333?
CVE-2025-59333 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H.
What CWE is associated with CVE-2025-59333?
CVE-2025-59333 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check npm dependencies for CVE-2025-59333?
Run the dependency tree command: 'npm ls @executeautomation/database-server'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-65hm-pwj5-73pw",
  "modified" : "2025-09-16T19:31:56Z",
  "published" : "2025-09-16T19:31:56Z",
  "aliases" : [ "CVE-2025-59333" ],
  "summary" : "@executeautomation/database-server does not properly restrict access, bypassing a \"read-only\" mode",
  "details" : "The MCP Server provided by ExecuteAutomation at https://github.com/executeautomation/mcp-database-server provides an MCP interface for agentic workflows to interact with different kinds of database servers such as PostgreSQL database. However, the `mcp-database-server` MCP Server distributed via the npm package `@executeautomation/database-server` fails to implement proper security control that properly enforce a \"read-only\" mode and as such it is vulnerable to abuse and attacks on the affected database servers such as PostgreSQL (and potentially other db servers that expose elevated functionalities) and which may result in denial of service and other unexpected behavior.\n\nThis MCP Server is also publicly published in the npm registry: https://www.npmjs.com/package/@executeautomation/database-server\n\n## Vulnerable code\n\nThe vulnerable code to SQL injection takes shape in several ways:\n- `startsWith(\"SELECT\")` can include multiple queries because the pg driver for the `client.query()` supports multi queries if terminated with a `;`\n- `startsWith(\"SELECT\")` can include denial of service queries for stored procedures and other internal db functions\n\nThe tool call [here in index.ts](https://github.com/executeautomation/mcp-database-server/blob/d6afa4be08eb05343195635fa9462746a6be3a59/index.ts#L272C1-L291C6) is vulnerable:\n\n```\n// Handle tool calls\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\n  switch (request.params.name) {\n    case \"read_query\": {\n      const query = request.params.arguments?.query as string;\n      \n      if (!query.trim().toLowerCase().startsWith(\"select\")) {\n        throw new Error(\"Only SELECT queries are allowed with read_query\");\n      }\n\n      try {\n        const result = await dbAll(query);\n        return {\n          content: [{ type: \"text\", text: JSON.stringify(result, null, 2) }],\n          isError: false,\n        };\n      } catch (error: any) {\n        throw new Error(`SQL Error: ${error.message}`);\n      }\n    }\n```\n\nThe MCP Server exposes the tool `read_query` with a naive attempt to guard for exclusive \"read-only\" mode that allows only data retrieval from the server by performing a check on the provided query string to ensure that it starts with a \"SELECT\" query.\n\nIn short, the code check `startWith(\"select\")` is not an adequate security control to strict for read-only mode queries and can be abused for side-effects and database-level operations.\n\n## Exploitation\n\nWhile allowing only `SELECT` type queries might seem like a good defense to allow only data retrieval and not data manipulation in any way (hence, \"read-only\" mode), it is a non-suficient way of protecting against database servers that expose extra functionality through internal function calls.\n\nSeveral examples that will allow side effects through `SELECT` queries:\n1. Stored procedures: `SELECT some_function_that_updates_data();`\n2. Internal database administrative operations: `SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE ...;`\n\nEven when the database is known not to have any stored procedures defined, an attacker can still cause significant availability and service disruption by executing `pg_terminate_backend()`.\n\nFollowing is a reproduction:\n\n- Simulate a long-running query, for example: `query = \"SELECT pg_sleep(5 * 60)\"`\n- Now, from the MCP programmatic interface, execute the following query `SELECT pid, usename, state, query FROM  pg_stat_activity;` to get the PID for the long running query\n- Next, use the same MCP interface to then request to run the following query: `SELECT pg_terminate_backend(PID);` and observe the long running query is now terminated\n\nSimilar database side-effects may be found in MySQL or SQLite.\n\n## Impact\n\nThe above exploitation surfaces two significant security risks: a denial of service that affects availability and confidentiality dislcosure that allows users unauthorized access to queries running on the server and potential leak of data.\n\n## Recommendation\n\n- Don't rely solely on the \"starts with\" `SELECT`\n- Strict access to specific tables that the user is only authorized to query for\n- Do not allow multiple SQL queries to be chained together like `SELECT * ...; INSERT INTO ...`\n- Require users that adopt this MCP Server to use fine-grained permissions on the database server with strict and explicit access to specific capabilities on the server.\n\n## CVE Details\n\nRecommended CWE: CWE-284: Improper Access Control\nRecommendec CVSS: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H\n\n## References and Prior work\n\n1. GitHub Kanban MCP Server found [vulnerable to command injection](https://github.com/advisories/GHSA-6jx8-rcjx-vmwf).\n2. iOS Simulator MCP Server found [vulnerable to command injection](https://github.com/advisories/GHSA-6f6r-m9pv-67jw).\n3. Liran's [Node.js Secure Coding](https://www.nodejs-security.com/book/command-injection) for educational materials on injection attacks and secure coding practices.\n4. [How to Bypass Access Control in PostgreSQL in Simple PSQL MCP Server for SQL Injection](https://www.nodejs-security.com/blog/how-to-bypass-access-control-in-postgresql-in-simple-psql-mcp-server-for-sql-injection)\n5. Reference example from prior security research on this topic, demonstrating how vulnerable MCP Server connected to Cursor is abused with prompt injection to bypass the developer's intended logic:\n\n![Cursor defined MCP Server vulnerable to command injection](https://res.cloudinary.com/snyk/image/upload/f_auto,w_2560,q_auto/v1747081395/Screenshot_2025-05-07_at_9.22.11_AM_d76kvm.png)\n\n## Credit\n\nDisclosed by [Liran Tal](https://lirantal.com)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@executeautomation/database-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/executeautomation/mcp-database-server/security/advisories/GHSA-65hm-pwj5-73pw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-59333"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/executeautomation/mcp-database-server"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-16T19:31:56Z",
    "nvd_published_at" : "2025-09-16T15:15:46Z"
  }
}