AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

GET /Index With [Slug] Dynamic Route Poisons ISR Cache For /, Causing Permanent 404

Next.js 16.2.1 and canary versions have a cache poisoning vulnerability where requesting /index with a root-level [slug] dynamic route that calls notFound() overwrites the ISR cache entry for /, causing permanent 404 for the home page until server restart.

criticalConfidence 95%Next.jsApp RouterHydrationServer ActionsAffected V16.2.1Affected V16.2.1-Canary.18

Origin Analysis

The resolvedPathname (after canonicalization like /index -> /) is mistakenly used as the ssgCacheKey for ISR caching. When a dynamic route [slug] handles /index and returns notFound(), the result is cached under the key /, replacing the home page's cached response.
1. npm install && npm run build && npm start 2. curl http://localhost:3000/ → returns 200 3. curl http://localhost:3000/index → returns 200 (stale cache) 4. Wait 2 seconds 5. curl http://localhost:3000/ → returns 404

Fixing Code Block

Edge Case Audit

修改缓存键后,已有部署中缓存的键会改变,可能导致所有ISR页面缓存未命中,需要重新验证;在多版本混合部署(金丝雀发布)期间,旧版本pod仍可能被攻击,需确保所有pod升级;如果回滚,旧缓存键可能不再被使用,需要手动清除缓存;另外,某些路由可能依赖规范化的缓存键进行去重,修改后可能重复缓存相同内容,增加存储开销。建议在发布前进行充分测试,并准备清除ISR缓存的脚本。

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state