Synopsis
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 = NoneThe 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.
Solution
Microsoft patched the vulnerable workflow with this following pull request: https://github.com/microsoft/Windows-driver-samples/pull/1355.
Disclosure Timeline
All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.
Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.
For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.
If you have questions or corrections about this advisory, please email [email protected]