Nuxt 3 vite-node dev server unauthenticated file read (CVE-2023-54417)

Nuxt 3.0.0 through 3.4.1 are vulnerable to a semi-arbitrary file read via the vite-node dev server middleware. An unauthenticated attacker can send a crafted GET request to /nuxt_vite_node/module/ with an absolute path to read sensitive files. Exploitation has been observed in the wild.

Details

CVE-2023-54417 affects Nuxt 3.0.0 before 3.4.2. The vulnerability exists in the vite-node dev server middleware. By supplying an absolute path as the moduleId parameter, an unauthenticated attacker can read files from the server. The Shadowserver Foundation observed exploitation attempts starting 2023-10-19.

Fixed version: Nuxt 3.4.2 (and later).

What to do

1. Upgrade Nuxt to 3.4.2 or later immediately. Verify the vendor advisory and release notes before deploying to production. 2. If you cannot upgrade immediately, ensure the Nuxt dev server and vite-node middleware are not exposed to untrusted networks; restrict access to trusted hosts only. 3. Review the NVD entry and vendor advisory for any additional mitigations or indicators of compromise. 4. Monitor access logs for requests to /__nuxt_vite_node__/module/ containing absolute file paths. 5. If exploitation is suspected, investigate for unauthorized file disclosure and rotate any credentials or secrets that may have been exposed.

Sources