Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: execute %SYSTEMROOT% cmd.exe directly during NSIS installer #8059

Merged
merged 3 commits into from Feb 20, 2024

Conversation

mmaietta
Copy link
Collaborator

@mmaietta mmaietta commented Feb 20, 2024

Copy link

changeset-bot bot commented Feb 20, 2024

🦋 Changeset detected

Latest commit: 6a9ca77

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Feb 20, 2024

Deploy Preview for car-park-attendant-cleat-11576 ready!

Name Link
🔨 Latest commit 6a9ca77
🔍 Latest deploy log https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/65d412953dc4500008c4a6f8
😎 Deploy Preview https://deploy-preview-8059--car-park-attendant-cleat-11576.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mmaietta mmaietta merged commit 8f4acff into master Feb 20, 2024
15 checks passed
@mmaietta mmaietta deleted the fix/cmd-line-nsexec branch February 20, 2024 03:02
@liudonghua123
Copy link

SO what's the difference between %SYSTEMROOT%\cmd.exe and %SYSTEMROOT%\System32\cmd.exe?

It seems %SYSTEMROOT%\cmd.exe is not exists.

image

@mmaietta
Copy link
Collaborator Author

mmaietta commented Mar 5, 2024

In powershell you can check env vars via gci env:

SystemRoot                     C:\WINDOWS

Crujera27 added a commit to VI-Software/vis-launcher that referenced this pull request Mar 5, 2024
Solo para Windows: el instalador de NSIS realiza una llamada al sistema para abrir cmd.exe a través de NSExec en el script del instalador .nsh. NSExec busca de forma predeterminada el directorio actual donde se encuentra el instalador antes de buscar PATH. Esto significa que si un atacante puede colocar un archivo ejecutable malicioso llamado cmd.exe en la misma carpeta que el instalador, el instalador ejecutará el archivo malicioso.
Parches

Corregido en electron-userland/electron-builder#8059
Soluciones alternativas

Ninguno, se ejecuta en el nivel del instalador antes de que la aplicación esté presente en el sistema, por lo que no hay forma de verificar si existe en un instalador actual.
Referencias

https://cwe.mitre.org/data/definitions/426.html
https://cwe.mitre.org/data/definitions/427
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants