Skip to content

How to avoid arbitrary command injection #150

@SirMishaa

Description

@SirMishaa

Hello

I want to execute this command :

Set-Clipboard -Value "Content here"

My issue is that doing something like that :

const command = PowerShell.command(['Set-Clipboard -Value ', `"${content}"`]);

This is a vulnerability because if I execute this command with this content, for example : "Hello World\"; explorer.exe / \""
It will start the explorer.exe process

How can I avoid this kind of issue? Or how can I sanitize the content before executing the command?

The documentation link seems to be broken :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions