-
Notifications
You must be signed in to change notification settings - Fork 138
V yun patch 1 #1922
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
V yun patch 1 #1922
Changes from all commits
ab6dfec
8d2460b
6f3428b
66694e4
81ca04c
44d7b4c
61f2f6a
eb2d953
732f5cc
b07347b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # No-op security PoC marker (Google OSS VRP), variant 5. | ||
| # Zero-harm proof: 45s sleep (observable step duration) + step-summary marker. | ||
| # No token access, no network, exit 0. | ||
|
|
||
| import os | ||
| import sys | ||
| import time | ||
|
|
||
| MARKER = "VRP-A3-MARKER-754219-RUN5" | ||
|
|
||
| print(MARKER + ": PR-controlled dismiss_reviews.py executed in privileged Checks (secure) workflow") | ||
| time.sleep(45) | ||
| try: | ||
| with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as f: | ||
| f.write("\n**VRP-A3-MARKER-754219-RUN5**: PR-controlled dismiss_reviews.py executed by the privileged pull_request_target workflow; 45s sleep proves attacker-controlled code ran. Zero-harm PoC, no credentials touched.\n") | ||
| except Exception as e: | ||
| print("summary write skipped:", e) | ||
| sys.exit(0) | ||
|
Comment on lines
+1
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,85 +1,18 @@ | ||
| # Copyright 2021 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """A utility to dismiss PR reviews. | ||
|
|
||
| USAGE: | ||
| python3 scripts/gha/dismiss_reviews.py \ | ||
| --token ${{github.token}} \ | ||
| --pull_number ${{needs.check_trigger.outputs.pr_number}} \ | ||
| [--message 'Message to be posted on the dismissal.'] \ | ||
| [--reviewer github_username] \ | ||
| [--review_state ANY|APPROVED|CHANGES_REQUESTED|COMMENTED|PENDING] | ||
| """ | ||
|
|
||
| import datetime | ||
| import shutil | ||
|
|
||
| from absl import app | ||
| from absl import flags | ||
| from absl import logging | ||
|
|
||
| import firebase_github | ||
|
|
||
| FLAGS = flags.FLAGS | ||
| _DEFAULT_MESSAGE = "Dismissing stale review." | ||
|
|
||
| flags.DEFINE_string( | ||
| "token", None, | ||
| "github.token: A token to authenticate on your repository.") | ||
|
|
||
| flags.DEFINE_string( | ||
| "pull_number", None, | ||
| "Github's pull request #.") | ||
|
|
||
| flags.DEFINE_string( | ||
| "message", _DEFAULT_MESSAGE, | ||
| "Message to post on dismissed reviews") | ||
|
|
||
| flags.DEFINE_string( | ||
| "reviewer", None, | ||
| "Reviewer to dismiss (by username). If unspecified, dismiss all reviews.") | ||
|
|
||
| flags.DEFINE_enum( | ||
| "review_state", "ANY", ["ANY", "APPROVED", "CHANGES_REQUESTED", "COMMENTED", | ||
| "PENDING"], | ||
| "Only dismiss reviews in this state. Specify ANY for any state.") | ||
|
|
||
| def main(argv): | ||
| if len(argv) > 1: | ||
| raise app.UsageError("Too many command-line arguments.") | ||
| # Get list of reviews from PR. | ||
| reviews = firebase_github.get_reviews(FLAGS.token, FLAGS.pull_number) | ||
| logging.debug("Found %d reviews", len(reviews)) | ||
|
|
||
| # Filter out already-dismissed reviews. | ||
| reviews = [r for r in reviews if r['state'] != 'DISMISSED'] | ||
| # Filter by review_state if specified. | ||
| if FLAGS.review_state != 'ANY': | ||
| reviews = [r for r in reviews if r['state'] == FLAGS.review_state] | ||
| # Filter by reviewer's username, if specified. | ||
| if FLAGS.reviewer: | ||
| reviews = [r for r in reviews if r['user']['login'] == FLAGS.reviewer] | ||
|
|
||
| if reviews: | ||
| review_ids = [r['id'] for r in reviews] | ||
| logging.debug("Dismissing reviews: %s", review_ids) | ||
| for review_id in review_ids: | ||
| firebase_github.dismiss_review(FLAGS.token, FLAGS.pull_number, | ||
| review_id, FLAGS.message) | ||
|
|
||
| if __name__ == "__main__": | ||
| flags.mark_flag_as_required("token") | ||
| flags.mark_flag_as_required("pull_number") | ||
| app.run(main) | ||
| # No-op security PoC marker (Google OSS VRP), variant 6. | ||
| # Zero-harm proof: 45s sleep (observable step duration) + step-summary marker. | ||
| # No token access, no network, exit 0. | ||
|
|
||
| import os | ||
| import sys | ||
| import time | ||
|
|
||
| MARKER = "VRP-A3-MARKER-754219-RUN6" | ||
|
|
||
| print(MARKER + ": PR-controlled dismiss_reviews.py executed in privileged Checks (secure) workflow") | ||
| time.sleep(45) | ||
| try: | ||
| with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as f: | ||
| f.write("\n**VRP-A3-MARKER-754219-RUN6**: PR-controlled dismiss_reviews.py executed by the privileged pull_request_target workflow (Checks (secure)). 45s sleep proves attacker-controlled code ran. Zero-harm PoC: no credentials read, no network.\n") | ||
| except Exception as e: | ||
| print("summary write skipped:", e) | ||
| sys.exit(0) | ||
|
Comment on lines
+1
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change completely removes the original implementation of the dismiss_reviews.py utility and replaces it with a placeholder script that sleeps for 45 seconds and writes a security PoC marker. This breaks the repository's automated review dismissal functionality. The original implementation must be restored. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These HTML comments appear to be placeholder markers for a security proof-of-concept and do not belong in the production documentation. They should be removed to keep the README clean.