Rightshold™ Sign up
Rightshold is live — the trust layer for AI agents.Launched November 23, 2026.Evidence Delivery$99 / 30 days · Offers are open — review the exact terms and the payment options shown on the service page before accepting.No token, everany ‘Rightshold token’ is not ours

Answers · MCP security

Our assistant used the DynamoDB MCP Server to design a data model and then generate a CDK app from dynamodb_data_model.json, and we ran cdk deploy on it. We've now seen CVE-2026-85654 about code injection in that CDK generator. How does it work, which versions are affected, and how do we check a CDK project we already generated?

Last updated

TL;DR: Yes, in versions 2.0.10 through 2.1.5. AWS's advisory GHSA-35jj-hwvm-792x (CVE-2026-85654, high, CVSS 3.1 7.8), published September 8, 2026, says the server's CDK generator rendered a Jinja2 template (stack.ts.j2) with autoescape off and copied table, index and attribute names from dynamodb_data_model.json into the generated TypeScript stack without adequate sanitization: nine string-literal positions and four identifier positions. A crafted name could carry TypeScript code, and running cdk synth or cdk deploy on the generated project would run it on the developer's machine with that user's privileges, including any AWS credentials in the environment. Version 2.1.6, uploaded to PyPI on August 14, 2026 (UTC), validates table and index names against DynamoDB's own naming rules and escapes every string value. Upgrade, regenerate any CDK app made by an affected version, and read the generated stack before running it.

What should I check, step by step?

1. Check the installed version of awslabs.dynamodb-mcp-server. 2.0.10 through 2.1.5 are affected and 2.1.6 is the first fixed release; PyPI listed 2.1.11 as the newest on November 24, 2026.

  1. If you run it with uvx and awslabs.dynamodb-mcp-server@latest, as the README shows, restart the MCP client and confirm the version the process loaded. Pinned versions don't update themselves.
  2. Find CDK projects generated by an affected version and regenerate them with 2.1.6 or later, instead of patching the old output by hand.
  3. Before any cdk synth or deploy of a generated stack, read the TypeScript file. Table, index and attribute names should be plain quoted strings; anything that closes a quote and adds code is a red flag.
  4. Check dynamodb_data_model.json itself: table and index names should only use letters, digits, underscore, hyphen and dot, 3 to 255 characters. Treat a model file from a pull request, a template or a shared folder as untrusted input.
  5. Run cdk synth and deploy with short-lived, least-privilege credentials, not an admin profile that stays in your shell.
  6. If an affected version ever generated a stack from a model file you didn't write and you ran it, check the machine and the AWS accounts those credentials could reach, and rotate the credentials.

What is CVE-2026-85654 in the DynamoDB MCP Server?

The DynamoDB MCP Server helps an AI coding assistant design DynamoDB tables and data models. Its generate_resources tool, with resource_type cdk, turns dynamodb_data_model.json into a CDK app that deploys the tables. AWS's advisory GHSA-35jj-hwvm-792x, published September 8, 2026, covers versions 2.0.10 through 2.1.5 and is filed under CWE-1336, special elements in a template engine not neutralized.

How does DynamoDB MCP Server 2.1.6 fix CVE-2026-85654 in the CDK generator?

The fix is pull request 4384 in awslabs/mcp, merged August 13, 2026, released in 2.1.6. Its commit message explains the split: table and index names land in TypeScript identifier positions, where escaping can't help, so they're now validated against the character set and length DynamoDB itself enforces (letters, digits, underscore, hyphen and dot, 3 to 255 characters). Attribute names have no character limit in DynamoDB, so they can't be rejected; instead every string-literal value in the template now goes through Jinja's tojson filter, which writes a properly quoted and escaped string.

Why does code generated by an MCP tool need review before you run it?

Code generators sit between data and code: they take values, usually names, and write them into a program someone will run later. If the template doesn't escape for the language it writes, any value can become code, and the moment of danger is the build or deploy step, often far from where the value came from.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “Before my assistant runs cdk deploy on the CDK app the DynamoDB MCP Server generated, ask me to approve that exact command, with a hash of the generated stack file, and wait for my yes or no.”

One-click setup

{
  "tool": "request_human_approval",
  "arguments": {
    "action": {
      "command": "cdk deploy",
      "generated_by": "awslabs.dynamodb-mcp-server generate_resources (resource_type cdk)",
      "server_version": "2.1.11",
      "stack_file_sha256": "<sha256 of the generated stack .ts file>"
    },
    "summary": "Deploy the DynamoDB tables from the generated CDK app after reading the stack file",
    "expires_in_minutes": 30
  }
}

Rightshold isn't affiliated with AWS. It doesn't scan MCP server code, generated CDK apps or data model files, and an approval record isn't a finding that a deploy is safe. Advisory details are as published by AWS in the awslabs/mcp repository's advisory GHSA-35jj-hwvm-792x, the fix as described in pull request 4384 and its template diff, the tool as described in the server's README, and release dates as listed on PyPI, all read November 24, 2026; advisories get updated, so confirm fixed versions on the linked pages.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'