/

CVE-2025-65200

Severity:

CRITICAL RISK

(9.6)

Script Injection (CWE-79) in LocalStack Deploy Endpoint

CVE-2025-65200

Awaiting Analysis

Vulnerability type

Category:

Script Injection

CWE:

CWE-79

Impact:

Arbitrary Code Execution

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical input-handling vulnerability in LocalStack allows crafted content hosted at a web-accessible URL to be processed through the CloudFormation deployment endpoint. If an attacker can cause a malicious URL to be supplied as templateURL, the content may execute arbitrary code within the Docker container.

A critical input-handling vulnerability in LocalStack allows crafted content hosted at a web-accessible URL to be processed through the CloudFormation deployment endpoint. If an attacker can cause a malicious URL to be supplied as templateURL, the content may execute arbitrary code within the Docker container.

Affected context

The issue affects LocalStack deployments that expose or otherwise permit access to the _localstack/cloudformation/deploy endpoint and accept externally controlled templateURL values. Risk is higher when the service can reach attacker-controlled web content and the container has sensitive credentials, mounted files, network access, or elevated privileges.

The issue affects LocalStack deployments that expose or otherwise permit access to the _localstack/cloudformation/deploy endpoint and accept externally controlled templateURL values. Risk is higher when the service can reach attacker-controlled web content and the container has sensitive credentials, mounted files, network access, or elevated privileges.

Exploit preconditions

  • Attack surface: The LocalStack CloudFormation deployment endpoint
  • Required access: The ability to submit or influence a deployment request containing a templateURL
  • Trigger point: Retrieval and processing of content referenced by the supplied URL
  • Why exploitation is possible: Attacker-controlled content is trusted during template handling and may be interpreted in a way that permits code execution inside the container
  • Attack surface: The LocalStack CloudFormation deployment endpoint
  • Required access: The ability to submit or influence a deployment request containing a templateURL
  • Trigger point: Retrieval and processing of content referenced by the supplied URL
  • Why exploitation is possible: Attacker-controlled content is trusted during template handling and may be interpreted in a way that permits code execution inside the container

Why this happens

The underlying flaw is insufficient neutralization and trust-boundary enforcement for externally supplied template content. A remote URL is accepted as deployment input without adequately ensuring that the retrieved content is limited to a safe, expected template representation. This behavior aligns with CWE-79: Improper Neutralization of Input During Web Page Generation, while the resulting execution path also reflects broader script or code injection risks.

The underlying flaw is insufficient neutralization and trust-boundary enforcement for externally supplied template content. A remote URL is accepted as deployment input without adequately ensuring that the retrieved content is limited to a safe, expected template representation. This behavior aligns with CWE-79: Improper Neutralization of Input During Web Page Generation, while the resulting execution path also reflects broader script or code injection risks.

Potential impact

  • Arbitrary code execution within the LocalStack Docker container
  • Exposure of environment variables, mounted files, or service credentials
  • Modification of emulated cloud resources and deployment state
  • Unauthorized access to reachable internal services
  • Container compromise that could support further lateral movement
  • Arbitrary code execution within the LocalStack Docker container
  • Exposure of environment variables, mounted files, or service credentials
  • Modification of emulated cloud resources and deployment state
  • Unauthorized access to reachable internal services
  • Container compromise that could support further lateral movement

General mitigation guidance

Mitigation generally focuses on reducing trust in remote template references and ensuring that template processing cannot interpret attacker-controlled content as executable logic.

Common defensive patterns include:

  • Prefer validated, locally controlled template sources over arbitrary remote URLs
  • Apply strict allowlists for permitted hosts, schemes, redirects, and content types
  • Enforce schema validation and content-size limits before template processing
  • Use parsers and execution paths that treat template data as inert data
  • Restrict container privileges, filesystem access, credentials, and outbound network connectivity
  • Require authentication and authorization for deployment endpoints
  • Isolate development emulators from sensitive production networks and secrets

Mitigation generally focuses on reducing trust in remote template references and ensuring that template processing cannot interpret attacker-controlled content as executable logic.

Common defensive patterns include:

  • Prefer validated, locally controlled template sources over arbitrary remote URLs
  • Apply strict allowlists for permitted hosts, schemes, redirects, and content types
  • Enforce schema validation and content-size limits before template processing
  • Use parsers and execution paths that treat template data as inert data
  • Restrict container privileges, filesystem access, credentials, and outbound network connectivity
  • Require authentication and authorization for deployment endpoints
  • Isolate development emulators from sensitive production networks and secrets

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis and code review checks for deployment endpoints that accept remote URLs
  • Review of URL-fetching logic, redirect handling, content validation, and template evaluation
  • Dynamic testing with controlled external resources and benign non-executable marker content
  • Web and container logs showing unusual requests to the deployment endpoint or unexpected outbound connections
  • Policy enforcement that blocks unapproved remote template locations and restricts container egress

Automated security review tools may help identify unsafe input flows and remote-content processing patterns.

Organizations can look for this weakness through:

  • Static analysis and code review checks for deployment endpoints that accept remote URLs
  • Review of URL-fetching logic, redirect handling, content validation, and template evaluation
  • Dynamic testing with controlled external resources and benign non-executable marker content
  • Web and container logs showing unusual requests to the deployment endpoint or unexpected outbound connections
  • Policy enforcement that blocks unapproved remote template locations and restricts container egress

Automated security review tools may help identify unsafe input flows and remote-content processing patterns.

Sources

SourceLink
localstack.comlocalstack.com
cyberroute.github.iocyberroute.github.io/post/2025-12-11-localstack-hack/
github.comgithub.com/localstack/localstack/blob/aba1ee84592d76f0a88dd286fcd83b65080e31ac/localstack-core/localstack/services/cloudformation/deploy_ui.py
github.comgithub.com/localstack/localstack/pull/13293/

Frequently asked

questions

It may be exploitable over the network when the LocalStack deployment endpoint is reachable and an attacker can influence the templateURL value. Exploitability depends on authentication, authorization, and network exposure.

The attacker generally needs permission to submit or modify a deployment request, or another way to cause LocalStack to process a URL they control.

Treat remote template locations as untrusted, restrict them to approved sources, validate the retrieved content against a strict schema, and ensure template data cannot be interpreted as executable code.

Protect deployment endpoints with strong access controls, minimize container privileges and network reachability, enforce outbound URL policies, and include remote-content injection tests in code review and CI security checks.

It may be exploitable over the network when the LocalStack deployment endpoint is reachable and an attacker can influence the templateURL value. Exploitability depends on authentication, authorization, and network exposure.

The attacker generally needs permission to submit or modify a deployment request, or another way to cause LocalStack to process a URL they control.

Treat remote template locations as untrusted, restrict them to approved sources, validate the retrieved content against a strict schema, and ensure template data cannot be interpreted as executable code.

Protect deployment endpoints with strong access controls, minimize container privileges and network reachability, enforce outbound URL policies, and include remote-content injection tests in code review and CI security checks.

Find out what's already
exploitable in your codebase.