Two critical vulnerabilities have been identified in Next.js, presenting severe risks to server operations. Assigned as CVE-2024-34350 and CVE-2024-34351 with a high severity rating of 7.5, these flaws enable response queue poisoning and Server-Side Request Forgery (SSRF), respectively. Response queue poisoning, discovered by Portswigger research, allows threat actors to manipulate front-end servers, potentially leading to desynchronized responses. Conversely, the SSRF vulnerability arises from a vulnerable API endpoint, _next/image, enabling attackers to exploit server actions and potentially fetch responses from internal hosts, thus compromising server integrity.
The first vulnerability, CVE-2024-34350, underscores the potential dangers of desynchronized responses in Next.js, particularly affecting routes utilizing the rewrites feature. Exploiting this flaw requires no workaround and has been addressed in Next.js versions 13.5.1 and newer releases. Meanwhile, the second vulnerability, CVE-2024-34351, exposes a flaw in the _next/image component, allowing attackers to manipulate image URLs and potentially trigger server-side image manipulation. This flaw, patched in Next.js version 14.1.1, highlights the critical importance of prompt updates to mitigate potential risks.
In response to these vulnerabilities, Next.js has released patches and security advisories urging users to upgrade to the latest versions promptly. The patches address the identified vulnerabilities and mitigate the associated risks, safeguarding server operations from potential exploitation. Additionally, researchers have published proof-of-concept demonstrations for CVE-2024-34351, providing detailed insights into the vulnerability’s exploitation and further emphasizing the urgency of updating Next.js installations to prevent potential compromises.