Skip to content

Conversation

hh-hunter
Copy link
Contributor

No description provided.

@google-cla google-cla bot added the cla: yes label Sep 30, 2021
@tooryx tooryx added the Contributor queue When a contributor has already one issue/PR in review, we put the following ones on hold with this. label Feb 1, 2024
@lokiuox
Copy link
Collaborator

lokiuox commented Nov 28, 2024

Hi @hh-hunter, thank you for your contribution! Can you please submit a testbed for this detector in the https://github.com/google/security-testbeds repo?

@ikkisoft
Copy link
Collaborator

ikkisoft commented Feb 8, 2025

google/security-testbeds#122 Testbed PR

@alessandro-Doyensec
Copy link
Collaborator

alessandro-Doyensec commented Mar 14, 2025

Hi @hh-hunter,

Thank you for your contribution!

I noticed that the code isn't formatted properly. I recommend following the guidelines outlined in the Public Review Process and using google-java-format to properly format your Java source code.

Additionally, I wasn't able to detect the vulnerability using your plugin on an actual vulnerable WordPress instance.

It seems that the DETECTION_STRING might be misused. From my understanding, it should be used as a regex.

Lastly, the test you provided passes even though the implementation is incorrect. To improve this, you should return actual passwd file as a mockWebResponse.

You can either define a constant in the test file or create a resource file, as demonstrated here: validRCEResponse.json.

Thanks again for your work, and I look forward to seeing the updates!


@Test
public void detect_whenVulnerable_returnsVulnerability() throws IOException {
mockWebResponse(CVE202139316VulnDetector.DETECTION_STRING);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Return a full passwd file here instead of the CVE202139316VulnDetector.DETECTION_STRING


@Test
public void detect_whenNotVulnerable_returnsVulnerability() throws IOException {
mockWebResponse("Hello Word");
Copy link
Collaborator

Choose a reason for hiding this comment

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

The test should simulate the behavior of a secure WordPress instance.

I would expect the WordPress service to return a 400 response (or something similar) rather than a response with a 'Hello World' message in the body.

if (httpResponse.status().code() != 200) {
return false;
} else {
return httpResponse.status().code() == 200 && (httpResponse.bodyString().get()).contains(DETECTION_STRING);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here you should use the regex "root:.*:0:0" to detect if the bodyString is an actual passwd file

@hh-hunter
Copy link
Contributor Author

@alessandro-Doyensec hi, I have made changes to the code as suggested.

@alessandro-Doyensec
Copy link
Collaborator

Hey @hh-hunter , thanks for the fixes, the plugin now correctly detects the vulnerability. I’ve got two more requests left:

  1. It seems that the .java src files are not properly formatted, to do so use

    java -jar google-java-format.jar --replace /path/to/files
  2. Check out the comment I left under add CVE-2021-39316 in the security-testbeds environment security-testbeds#122 (comment)

@hh-hunter
Copy link
Contributor Author

Hey @hh-hunter , thanks for the fixes, the plugin now correctly detects the vulnerability. I’ve got two more requests left:

  1. It seems that the .java src files are not properly formatted, to do so use

    java -jar google-java-format.jar --replace /path/to/files
    
  2. Check out the comment I left under add CVE-2021-39316 in the security-testbeds environment security-testbeds#122 (comment)

Okay, I'm looking for an environment without loopholes, because it's too long and a little time-consuming.

@ikkisoft
Copy link
Collaborator

Hi @hh-hunter,

I understand your frustration, however we cannot directly push changes to your PRs. Even small changes require your involvement.

Regarding the introduction of testbeds, I believe that you've started contributing to this project before it was mandatory. Apologies for the change but over time we realized that testbeds are essential to ensure high-quality plugins.

We hope that you will continue to contribute to Tsunami and we will certainly keep everything in consideration when evaluating your contribution. Thanks again.

Cc: @maoning

@tooryx
Copy link
Member

tooryx commented Jul 4, 2025

Hi @hh-hunter,

This vulnerability is too old and the testbed is difficult to setup again. Closing this issue.
We will prioritize your other contributions.

~tooryx

@tooryx tooryx closed this Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Contributor queue When a contributor has already one issue/PR in review, we put the following ones on hold with this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants