{"id":"CVE-2026-15921","aliases":["CVE-2026-15921"],"related":[],"kind":"vulnerability","state":"published","title":"nvm path traversal via a malicious mirror's LTS codename writes outside the alias directory","summary":"Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.32.1 through 0.40.5, `nvm ls-remote` (and other commands that refresh remote LTS aliases, such as `nvm install --lts`) parse the node.js mirror's `index.tab` and use each release's LTS codename field as an alias filename without validating it. A malicious, compromised, or man-in-the-middled mirror can return an LTS codename containing path-traversal sequences such as `../../../.bashrc`, causing nvm to write the associated version string to a path outside `$NVM_DIR/alias`. With the default layout (`$NVM_DIR` is `~/.nvm`), this can create or overwrite files in the user's home directory, including shell startup files, which can lead to code execution in a later shell session. Exploitation requires the victim to use a hostile mirror -- via a compromised mirror or CDN, a network man-in-the-middle, or a maliciously configured `NVM_NODEJS_ORG_MIRROR`/`NVM_IOJS_ORG_MIRROR` -- and to run an affected command. Version 0.40.6 validates remote LTS codenames as safe alias filenames and rejects `..` path components when writing alias files.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.32.1 through 0.40.5, `nvm ls-remote` (and other commands that refresh remote LTS aliases, such as `nvm install --lts`) parse the node.js mirror's `index.tab` and use each release's LTS codename field as an alias filename without validating it. A malicious, compromised, or man-in-the-middled mirror can return an LTS codename containing path-traversal sequences such as `../../../.bashrc`, causing nvm to write the associated version string to a path outside `$NVM_DIR/alias`. With the default layout (`$NVM_DIR` is `~/.nvm`), this can create or overwrite files in the user's home directory, including shell startup files, which can lead to code execution in a later shell session. Exploitation requires the victim to use a hostile mirror -- via a compromised mirror or CDN, a network man-in-the-middle, or a maliciously configured `NVM_NODEJS_ORG_MIRROR`/`NVM_IOJS_ORG_MIRROR` -- and to run an affected command. Version 0.40.6 validates remote LTS codenames as safe alias filenames and rejects `..` path components when writing alias files.","source":"cvelist"},{"lang":"es","text":"Node Version Manager (nvm) es una función de shell compatible con POSIX para gestionar múltiples versiones de node.js. En las versiones 0.32.1 a 0.40.5, ’nvm ls-remote’ (y otros comandos que actualizan alias LTS remotos, como ’nvm install --lts’) analizan el ’index.tab’ del mirror de node.js y usan el campo de nombre en clave LTS de cada lanzamiento como un nombre de archivo de alias sin validarlo. Un mirror malicioso, comprometido o con un ataque de man-in-the-middle puede devolver un nombre en clave LTS que contenga secuencias de path-traversal como ’.. / .. / .. / .bashrc’, haciendo que nvm escriba la cadena de versión asociada a una ruta fuera de ’$NVM_DIR/alias’. Con la configuración predeterminada (’$NVM_DIR’ es ’~/.nvm’), esto puede crear o sobrescribir archivos en el directorio de inicio del usuario, incluidos los archivos de inicio de shell, lo que puede llevar a la ejecución de código en una sesión de shell posterior. La explotación requiere que la víctima use un mirror hostil -- a través de un mirror o CDN comprometido, un man-in-the-middle de red, o un ’NVM_NODEJS_ORG_MIRROR’/’NVM_IOJS_ORG_MIRROR’ configurado maliciosamente -- y que ejecute un comando afectado. La versión 0.40.6 valida los nombres en clave LTS remotos como nombres de archivo de alias seguros y rechaza los componentes de ruta ’..’ al escribir archivos de alias.","source":"nvd"}],"published":"2026-07-15T21:16:46.936Z","modified":"2026-10-24T21:10:00.130Z","severity":{"scorer":"harborist","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","score":2.1,"rating":"LOW"},"severities":[{"scorer":"harborist","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","score":2.1,"rating":"LOW"},{"scorer":"harborist","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N","score":3.1,"rating":"LOW"}],"cwes":["CWE-22","CWE-73"],"affected":[{"ranges":[{"type":"semver","introduced":"0.32.1","fixed":"0.40.6","status":"affected"}],"vendor":"nvm-sh","product":"nvm","repo":"https://github.com/nvm-sh/nvm","source":"cvelist"}],"references":[{"url":"https://github.com/nvm-sh/nvm/security/advisories/GHSA-4ghp-wxpw-rhpg","tags":["exploit","vendor-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/nvm-sh/nvm/commit/9275c5badda1d9d0cdad6f34598a111033eadb42","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":["Sy2n0 (https://github.com/Sy2n0)","Jordan Harband (https://github.com/ljharb)"],"assigner":"harborist","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-07-16T12:53:15.866Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-15921","url":"https://www.cve.org/CVERecord?id=CVE-2026-15921","licence":"CVE Terms of Use","modified":"2026-07-16T12:53:35.897Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-15921","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-15921","licence":"Public domain","modified":"2026-10-24T21:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:28.351Z","epss":{"score":0.00264,"percentile":0.19495,"date":"2026-12-01T12:00:22.000Z"}}