nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] notifications.ts Windows PowerShell string injection

Open akramcodez opened this issue 3 months ago • 1 comments

Description

The script uses single-quote interpolation for title and message and only escapes single quotes (' -> ''). Backticks ( ` ) inside the user-controlled title/message may allow arbitrary code execution by PowerShell depending on the evaluation context (or simply break the notification if PowerShell attempts to resolve variables).

Environment

  • OS: Windows
  • Node version: v22.20.0
  • Nanocoder version: 1.30.0
  • Provider: N/A
  • Model: N/A

Steps to Reproduce

  1. On Windows, trigger a notification where the title is `whoami` or similar.
  2. Observe the notification.

Expected Behavior

The notification text should safely render the exact literal characters.

Actual Behavior

Code might be executed or formatting might break.

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] I can reproduce this issue consistently
  • [x] This issue occurs with the latest version of nanocoder

akramcodez avatar Sep 02 '26 06:09 akramcodez

Hi @akramcodez would love to work on this issue!

rishu685 avatar Sep 06 '26 05:09 rishu685