Skip to content

Python: Create test_poc.py#13913

Closed
yigolden wants to merge 1 commit intomicrosoft:mainfrom
yigolden:poc-workflow-poisoning
Closed

Python: Create test_poc.py#13913
yigolden wants to merge 1 commit intomicrosoft:mainfrom
yigolden:poc-workflow-poisoning

Conversation

@yigolden
Copy link
Copy Markdown

testing

@yigolden yigolden requested a review from a team as a code owner April 24, 2026 01:17
@moonbox3 moonbox3 added the python Pull requests for the Python Semantic Kernel label Apr 24, 2026
@github-actions github-actions Bot changed the title Create test_poc.py Python: Create test_poc.py Apr 24, 2026
@yigolden
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Automated Code Review

Reviewers: 4 | Confidence: 97%

✗ Correctness

This PR adds a file that serves no legitimate testing purpose — it is a CI/CD injection proof-of-concept. The test always passes (assert True) and exists solely to inject a Markdown phishing payload into the JUnit XML report generated by pytest (--junitxml=pytest.xml). The CI workflows (python-unit-tests.yml, python-test-coverage.yml) upload that XML, and python-test-coverage-report.yml renders it via junitxml-path: python/pytest.xml. The injected payload — a fake 'SECURITY NOTICE' with a link masquerading as Microsoft SSO — would be rendered in the coverage report, enabling social engineering against anyone viewing the CI results. This file must not be merged.

✗ Security Reliability

This PR is a deliberate CI/CD injection attack. It introduces a test file whose sole purpose is to inject a phishing payload (fake 'Security Notice' with a clickable link) into the JUnit XML report generated by pytest. The python-test-coverage.yml workflow (line 39) runs pytest with --junitxml=pytest.xml over ./tests/unit, which would include this file. The generated pytest.xml—containing the attacker's markdown payload in the test parametrization and the class name TestCoverage__INJECTION_POINT—is then uploaded as an artifact and consumed by python-test-coverage-report.yml, which uses MishaKav/pytest-coverage-comment (line 42-50) to render it as a GitHub PR comment using elevated pull-requests: write permissions and secrets.GH_ACTIONS_PR_WRITE. The markdown payload would be rendered in the PR comment, presenting a convincing phishing message that appears to come from the CI/CD pipeline. The test body is assert True to guarantee the coverage workflow succeds, which is the trigger condition for the reporting workflow (github.event.workflow_run.conclusion == 'success'). This PR must be rejected and treated as a security incident.

✗ Test Coverage

This PR adds a file that is not a legitimate test — it is a proof-concept for a CI/CD injection attack. The class name TestCoverage__INJECTION_POINT is designed to inject content into the classname attribute of JUnit XML reports (pytest.xml). The PAYLOAD constant contains a phishing-style Markdown lure mimicking a Microsoft SSO re-authentication prompt. The test body is assert True, meaning it tests no actual behavior. This file has no relationship to Semantic Kernel functionality and should not be merged.

✗ Design Approach

This change does not fix or guard the reporting vulnerability; it checks in a permanently passing proof-of-concept that injects attacker-controlled content into the normal JUnit artifacts consumed by PR-reporting workflows. The right place to address this is at the report producer/consumer boundary by sanitizing or escaping rendered test metadata and asserting that behavior directly, not by embedding a phishing payload in the repository’s unit suite.

Suggestions

  • Treat this PR as a security incident. Investigate the submitter's other contributions for similar injection attempts.
  • Harden the CI pipeline by sanitizing or escaping content from JUnit XML before rendering it in PR comments. Consider adding a focused regression test that asserts the report producer/consumer escapes untrusted test metadata (class names, parametrized values) before they reach human-facing surfaces.

Automated review by yigolden's agents

@moonbox3
Copy link
Copy Markdown
Collaborator

Please provide meaningful contributions and not test PRs against the upstream repo. This can be done on your fork. Thank you.

@moonbox3 moonbox3 closed this Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants