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

CVE-2024-21181 Plugin #570

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

Conversation

leonardo-doyensec
Copy link
Collaborator

@leonardo-doyensec leonardo-doyensec commented Dec 13, 2024

Hello,
here it is the detector for Weblogic CVE-2024-21181. The issue is detected via a DNS callback, hence the Tsunami Callback Server needs to be set up in order to recieve a DNS query properly.

You can find the tesbed here google/security-testbeds#102


### Oracle Library

The plugin needs the `wlclient.jar` library from Oracle WebLogic to communicate with the Oracle WebLogic server, but since it's proprietary software we can't include it in the repo.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the jar still needed with the current implementation?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @maoning, yes it is still required for the detection to work. Without it, the plugin will still compile (as to not disrupt the setup process), but it will exit early with a warning during the detection phase asking the user to recompile it with the Oracle library. Note that the warning is only printed AFTER fingerprinting, if a target is actually confirmed to be Weblogic, so it won't appear during scans on unrelated software.

@lokiuox
Copy link
Collaborator

lokiuox commented Feb 5, 2025

Pushed a new version which does not use any Oracle libraries. The protocol was reverse-engineered and the network communications between the detector and the WebLogic server are all handled internally now.

@maoning
Copy link
Collaborator

maoning commented Feb 18, 2025

Pushed a new version which does not use any Oracle libraries. The protocol was reverse-engineered and the network communications between the detector and the WebLogic server are all handled internally now.

Thank you, I'm running into a internal compilation error about AutoValue class cannot be extended:

...doyensec/detectors/weblogic_cve_2024_21181/src/main/java/com/google/tsunami/plugins/detectors/cves/cve202421181/weblogic/requests/InitRequest.java:10: error: [ExtendsAutoValue] Do not extend an @AutoValue class in non-generated code.
public class InitRequest extends GiopPacket {
       ^

.../doyensec/detectors/weblogic_cve_2024_21181/src/main/java/com/google/tsunami/plugins/detectors/cves/cve202421181/weblogic/requests/WeblogicIiopRequest.java:8: error: [ExtendsAutoValue] Do not extend an @AutoValue class in non-generated code.
public abstract class WeblogicIiopRequest extends GiopPacket {
                ^

Here are the recommendations:

@AutoValue classes are intended to be closed, with a single implementation with known semantics. Implementing them by hand is extremely dangerous.

Here are some common cases where we have seen code that extends @AutoValue classes and recommendations for what to do instead:

* Overriding the getters to return given values. This should usually be replaced by creating an instance of the @AutoValue class with those values.

* Having the @AutoValue.Builder class extend the @AutoValue class so it inherits the abstract getters. This is wrong since the Builder doesn't satisfy the contract of its superclass and is better implemented either by repeating the methods or by having both the @AutoValue class and the Builder implement a common interface with these getters.

* In other cases of extending the @AutoValue class and implementing its abstract methods, it would be more correct to have the @AutoValue class and the other class have a common supertype.

Could you create a supertype or just remove the usage of AutoValue for this case?

@lokiuox
Copy link
Collaborator

lokiuox commented Feb 18, 2025

Hey @maoning, for some reason I don't get the same issue while compiling. Anyway, I changed the implementation slightly to use the "factory" design pattern, so now those classes no longer inherit from GiopPacket.

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

Successfully merging this pull request may close these issues.

3 participants