Skip to content

Fix for bug MSRC97007 #5206

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

rajmishra1997
Copy link
Contributor

@rajmishra1997 rajmishra1997 commented May 9, 2025

Fix for issue https://portal.microsofticm.com/imp/v5/incidents/details/31000000353897/summary , which describes a vulnerability in Azure Pipelines where malicious input can be injected through Git metadata, not necessarily through built-in pipeline variables.

For example, in the following YAML pipeline code:
$authorEmail = git log -1 --pretty=format:"%ae" Write-Host "Email address of the author is $authorEmail"

Git user email could be updated such as :
git config user.email "##vso[task.setvariable variable=downloadUrl]https://www.evil.com"
This would inject a VSO command into the pipeline runtime and update the Url variable.

As fix:
The code has been updated to include a condition that checks whether the Git author name, email address, or commit message contains any VSO commands, preventing unintended command execution. Also built-in variables 'Build.RequestedForEmail, Release.ReleaseDeploymentRequestedForEmail, Release.ReleaseRequestedForEmail' are included as 'VariablesVulnerableToExecution'

Explain the context or motivation behind this PR. Include links to any related Azure DevOps Work Items or GitHub issues. Fixes AB#2277633
📌 How to link to ADO Work Items

Risk Assessment (Low / Medium / High) : Low

Assess the risk level and justify your assessment. For example: code path sensitivity, usage scope, or backward compatibility concerns.


Unit Tests Added or Updated (Yes / No) : Yes

Indicate whether unit tests were added or modified to reflect the changes.


Additional Testing Performed : Changes tested locally

List manual or automated tests performed beyond unit tests (e.g., integration, scenario, regression).

@rajmishra1997 rajmishra1997 requested review from a team as code owners May 9, 2025 08:15
@rajmishra1997
Copy link
Contributor Author

rajmishra1997 commented May 9, 2025

/azp run

Copy link

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@tarunramsinghani tarunramsinghani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make sure there are no unneccesary failures

@rajmishra1997 rajmishra1997 force-pushed the users/rajmishra/FixMSRC97007 branch from b21b4b4 to 07a7a23 Compare May 14, 2025 16:49
@rajmishra1997
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Successfully merging this pull request may close these issues.

3 participants