Microsoft GitHub Repository Windows-driver-samples Workflow Remote Code Execution
The GitHub public repository at https://github.com/microsoft/Windows-driver-samples has a GitHub Action configured which allows for Remote Code Execution on the GitHub runner: https://github.com/microsoft/Windows-driver-samples/blob/main/.github/workflows/tag-codeowner-on-issue.yml
The vulnerability lies in this part of the GitHub workflow:
run: | python3 - <<EOF import os import re import requests issue_body = """${{ github.event.issue.body }}""" selected_path = None
The issue body is directly interpolated into a Python here-doc without sanitization. An attacker can then inject arbitrary Python code by crafting a malicious issue body containing string terminators (triple quotes) to break out of the string literal and inject code.
By exploiting this vulnerability, an attacker with an unprivileged GItHub account could exfiltrate secrets available to the workflow run and perform unauthorized operations on the target GitHub repository.







