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

extension Winrm Web IIS Management blocked #1224

Open
1 of 4 tasks
Am-Na-D opened this issue Feb 26, 2024 · 1 comment
Open
1 of 4 tasks

extension Winrm Web IIS Management blocked #1224

Am-Na-D opened this issue Feb 26, 2024 · 1 comment
Assignees

Comments

@Am-Na-D
Copy link

Am-Na-D commented Feb 26, 2024

Extension name

Winrm IIS Web App Management

Extension version

3.*

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

Azure Devops Server 2022.0.1

Operation system

windows server 2022 /2019/2016

Question

hi 
recently we faced a new problem and our antivirus blocked the Winrm iis web management task in a remote machine.
I look into the extension (https://github.com/microsoft/azure-pipelines-extensions/tree/master/Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV3) and understand the reasons of the block is Invoke-expression command that exists inside on of the PowerShell in extension files.
now I wanna know, why that just happened.
What's the problem?
why AV must block this command?
is it a risky command for Windows?

NOTICE: the brand of our AN is BitDefender
NOTICE: our BitDefender use AMSI of the windows
@LeftTwixWand LeftTwixWand self-assigned this May 13, 2024
@LeftTwixWand
Copy link
Contributor

Hi @Am-Na-D
Generally, your defender identifies the potential vulnerability correctly.

The use of Invoke-Expression in PowerShell can be risky, particularly when incorporating unsanitized user input:

# Simulated user input that includes an injection attempt
$userInput = "Get-Date && Remove-Item -Path C:\SensitiveFile -Force"

# Dangerous use of Invoke-Expression with user input
Invoke-Expression "Write-Output 'The current date is: ';$userInput"

As the example shows, the command executed by Invoke-Expression might contain some malicious command, attaches via && operator. So, it's not recommended to use Invoke-Expression.

From our side we're trying to minimize its usage as much as we can. Also, we have built in sanitization for commands, we're executing, which prevents potential code injections.

Hope I answered your question😊
If you don't have any other questions - feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants