---
id: "GHSA-673q-mjm6-r5xr"
kind: "vulnerability"
aliases: ["GHSA-673q-mjm6-r5xr"]
title: "Next.js: Unauthenticated Remote Code Execution in `use cache` functions returning typed arrays"
severity: "critical"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "next", "fixed": ["16.4.1"], "affected": ">= 16.0.0, <= 16.4.0", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["app-router", "cwe-502", "next.js", "package", "self-hosted"]
not_affected_if: ["version-16.4.1-or-later", "version-below-16.0.0"]
published_at: "2026-10-22T16:42:31+00:00"
first_seen_at: "2026-10-23T19:11:31+00:00"
updated_at: "2026-10-23T20:06:37+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-673q-mjm6-r5xr", "first_seen_at": "2026-10-23T19:11:31+00:00"}]
---

# Next.js: Unauthenticated Remote Code Execution in `use cache` functions returning typed arrays

Next.js versions 16.0.0 through 16.4.0 contain a deserialization flaw (CWE-502) in App router apps that use a 'use cache' function returning multiple typed arrays. An unauthenticated remote attacker can execute code on the server.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:next affected >= 16.0.0, <= 16.4.0 fixed 16.4.1

## How to check

Run `npm ls next` and check whether the installed version is between 16.0.0 and 16.4.0 inclusive. Search the app for 'use cache' functions that return typed arrays.

## Fix

Upgrade next to 16.4.1 or later. No workaround is documented, so upgrade even if no such function is found.

## Timeline

- 2026-10-23T19:11:31+00:00 ghsa https://github.com/advisories/GHSA-673q-mjm6-r5xr

## From the sources

## Impact

A vulnerability in applications using App router with Cache Component can lead to remote code execution. The application needs to have a `use cache` function that returns multiple typed arrays.

## Workaround

There is no known workaround for affected applications with such `use cache` functions. You should upgrade immediately even if your application does not have similar functions.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
