The vulnerability lies in the @astrojs/node package, specifically within the createStaticHandler function in packages/integrations/node/src/serve-static.ts. The function is responsible for handling static file serving and, in certain configurations, enforcing trailing slashes on URLs.
The vulnerability occurs when the trailingSlash option is set to "always". In this case, if a request is made with a URL path that starts with a double slash (e.g., //malicious.com), the server would incorrectly construct a redirect to that external domain. This is a classic open redirect vulnerability (CWE-601).
The fixing commit 5fc3c599cacb0172cc7d8e1202a5f2e8685d7ef2 addresses this by introducing a new check, isInternalPath, before creating the redirect. This function validates that the path is not an external URL, thus closing the vulnerability.
The vulnerable function, createStaticHandler, would be the one to appear in a runtime profile during exploitation, as it contains the logic that processes the malicious input and generates the redirect.