The vulnerability lies in the @adonisjs/bodyparser package, specifically within the PartHandler class that processes multipart file uploads. The root cause is an uncontrolled resource consumption (CWE-400) vulnerability. When a file is uploaded, the #handleChunk method within PartHandler buffers the initial chunks of the file in memory to detect its file type by analyzing its magic numbers. However, the vulnerable version of the code did not enforce any limit on how large this buffer could grow. An attacker could exploit this by sending a specially crafted file with a data stream that never matches any recognized magic numbers. This would cause the server to continuously buffer the incoming data, leading to unbounded memory growth. Eventually, the server would run out of memory and the Node.js process would crash, causing a Denial of Service (DoS). The patch mitigates this by introducing a size limit of 4100 bytes on the buffer. If the file type cannot be determined after buffering this amount of data, the system falls back to determining the file type from the client-provided filename, thus preventing the unbounded memory allocation.