Skip to content
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

AI PRP: Request Flyte Exposed UI & API #425 #528

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hayageek
Copy link
Contributor

Hi @tooryx ,
This is the PR for detecting RCE in exposed Flyte Console. Related issue is: #425
Also, created a PR in security-testbeds to setup the Flyte Console google/security-testbeds#84

Flyte supports only gRPC APIs, and I have utilized the flyte-java SDK to make these API calls. Here's how the RCE vulnerability can be exploited in an exposed Flyte Console:

  1. Create a new Project using the registerProject API.
  2. Within the Project, define a Task by specifying a Docker image using the createTask API.
  3. Execute the Task within the cluster using the createExecution API. Note that the createExecution call may fail initially because createTask configures certain aspects in the Kubernetes cluster. In such cases, multiple attempts may be necessary. Once successfully executed, the Task spins up a Docker image and performs RCE within the POD.

Added Flyte Console Detector with RCE
@hayageek
Copy link
Contributor Author

Hi @tooryx , Can you review the code provide comments ?

@tooryx
Copy link
Member

tooryx commented Sep 16, 2024

Hi @hayageek,

Please be patient, a reviewer will pick-up your PR when they get through the queue.

~tooryx

Copy link
Collaborator

@leonardo-doyensec leonardo-doyensec left a comment

Choose a reason for hiding this comment

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

Hello @hayageek, thank you for your contribution.
You can find some style issues to address down below.

@leonardo-doyensec leonardo-doyensec added the Contributor main The main issue a contributor is working on (top of the contribution queue). label Oct 15, 2024
@hayageek
Copy link
Contributor Author

@leonardo-doyensec ,
I have implemented the review comments. I tested the changes, please find the attached log file & screenshot.
Below is the command to run the scanner
java -cp "main/build/libs/tsunami-main-0.0.25-SNAPSHOT-cli.jar:plugins/*" -Dflogger.level=DEBUG com.google.tsunami.main.cli.TsunamiCli --uri-target=http://127.0.0.1:30081 --scan-results-local-output-filename=out.json --scan-results-local-output-format=JSON --callback-address=172.17.0.1 --callback-port=8881 --callback-polling-uri=http://127.0.0.1:8880

flyte-log.txt
Screenshot 2024-10-18 at 2 15 32 PM

@tooryx tooryx linked an issue Oct 23, 2024 that may be closed by this pull request
@hayageek
Copy link
Contributor Author

@leonardo-doyensec @tooryx
Can you review the PR

@hayageek
Copy link
Contributor Author

hayageek commented Nov 4, 2024

Hi @leonardo-doyensec,
any update ?

@hayageek
Copy link
Contributor Author

Hi @tooryx @leonardo-doyensec
This PR was created three months ago, and I would greatly appreciate your review when you have the time. Alternatively, it might be better to hold off on accepting pull requests until you’re available to address them.

@tooryx
Copy link
Member

tooryx commented Nov 21, 2024

Hi @hayageek,

Sorry, I know that this is frustrating. We are merging things in reverse chronological order and doing our best, but we sometimes have competing priorities as you can imagine.

That being said, I am not sure how pausing accepting pull requests would help? I actually think it would make things even worse.

~tooryx

@leonardo-doyensec
Copy link
Collaborator

Hello @hayageek,
i'm noticing that the callback server receives only the polling request along with this error
INFO: Interaction with secret '<redacted>' NOT found and polled by IP <redacted>
Can you please check?

@hayageek
Copy link
Contributor Author

hayageek commented Dec 6, 2024

@leonardo-doyensec ,
It seems the request successfully reached the callback server, indicating that RCE was executed in the container. You can refer to the relevant code here: InteractionPollingHandler.java#L62.

Could you share the commands you're using to run both the callback server and the Tsunami scanner? It appears there might be an issue with the callback server's IP address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor main The main issue a contributor is working on (top of the contribution queue).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AI PRP: Request Flyte Exposed UI & API
3 participants