testing-nccl-test-dymanic-branch#5322
testing-nccl-test-dymanic-branch#5322aslam-quad wants to merge 2 commits intoGoogleCloudPlatform:developfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the flexibility of the NCCL daily test by allowing it to fetch the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the NCCL test playbook to use the ansible.builtin.git module for cloning, improving idempotency and clarity, and introduces environment variables for dynamic repository owner and branch selection. While this enhances flexibility, it introduces a critical security risk of CI/CD poisoning, allowing arbitrary code execution on the CI runner from a malicious fork. Additionally, several shell tasks are vulnerable to command injection due to improper quoting of Jinja2 variables. It is strongly recommended to implement strict validation for the repository source and use the quote filter for all variables in shell commands. Please ensure the pull request description is fully completed according to contribution guidelines.
| ansible.builtin.git: | ||
| repo: "https://github.com/{{ lookup('env','REPO_OWNER') | default('GoogleCloudPlatform', true) }}/cluster-toolkit.git" | ||
| dest: "{{ ansible_user_dir }}/cluster-toolkit" | ||
| version: "{{ lookup('env','BRANCH_NAME') | default('develop', true) }}" | ||
| update: yes |
There was a problem hiding this comment.
The playbook uses environment variables REPO_OWNER and BRANCH_NAME (retrieved via lookup('env', ...) on lines 19-20 and 24-26) to determine the repository and branch to clone. In a CI/CD environment that triggers on Pull Requests (especially from forks), these variables are often populated with the fork's owner and branch name. Since the playbook subsequently executes scripts from the cloned repository (e.g., import_pytorch_container.sh on line 33, build-nccl-tests.sh on line 34, and run-nccl-tests.sh on line 62), an attacker can achieve arbitrary code execution on the CI runner by submitting a PR from a malicious fork. This is a classic CI/CD poisoning vulnerability.
There was a problem hiding this comment.
This needs to be addressed.
94a092d to
d033e6a
Compare
71dafbe to
6e54def
Compare
6e54def to
8a91929
Compare
Submission Checklist
NOTE: Community submissions can take up to 2 weeks to be reviewed.
Please take the following actions before submitting this pull request.