Skip to content

Conversation

@AliceMilshtein
Copy link

@AliceMilshtein AliceMilshtein commented Mar 7, 2025

Overview

Briefly describe the purpose, goals, and changes or improvements made in this pull request.

Related Issues

Specify any related issues or pull requests by linking to them.

Checklist

  • Update help
  • Update changelog
  • Run ./gradlew spotlessApply for code formatting
  • Write tests
  • Check code coverage
  • Sign-off commits
  • Squash commits
  • Use a descriptive title

For more details, please refer to the developer rules and guidelines.

@github-actions
Copy link

github-actions bot commented Mar 7, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@psiinon
Copy link
Member

psiinon commented Mar 7, 2025

Logo
Checkmarx One – Scan Summary & Details872bcac0-8b30-474d-b823-2d6ff9d08ebb

Great job, no security vulnerabilities found in this Pull Request

private AuthRequestDetails authReq;
private HttpMessage fallbackMsg;
private int firstHrefId;
private List<HttpMessage> httpMessages = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

This worries me :)
HttpMessage's can be big objects, so we try not to hold on to them for too long.
In other places we've saved the History IDs (which are just ints) and then you can read the messages from the DB when they are needed.

Copy link
Member

@psiinon psiinon left a comment

Choose a reason for hiding this comment

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

Just some initial comments, will give a fuller review in a bit :)

@@ -0,0 +1,167 @@
package org.zaproxy.zap.extension.ascanrulesAlpha;
Copy link
Member

Choose a reason for hiding this comment

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

All code should have the standard header - you can just rip it off from any other class, just remember to change the year to 2025 😁

Copy link
Member

Choose a reason for hiding this comment

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

The spotlessApply task will add them with the proper year.

}
@Override
public String getName() {
return "Blank code TOTP Scan Rule";
Copy link
Member

Choose a reason for hiding this comment

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

}
@Override
public int getCategory() {
return Category.INFO_GATHER;
Copy link
Member

Choose a reason for hiding this comment

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

If we're actually doing testing then maybe Server Security? Or Miscellaneous.
Thats unless we want to add a new "Authentication" category??


}
else{
//LOGGER.error("Authentication Method is not browser based.");
Copy link
Member

Choose a reason for hiding this comment

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

Either actually include logging (e.g. at DEBUG level) or remove the commented code

@psiinon
Copy link
Member

psiinon commented Mar 28, 2025

The build is failing due to formatting issues.
Run ./gradlew :addOns:ascanrulesAlpha:spotlessApply to fix these violations.

Comment on lines 47 to 54
@Override
public String getSolution() {
return "N/A";
}
@Override
public String getReference() {
return "N/A";
}
Copy link
Member

Choose a reason for hiding this comment

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

You could just not override these methods

@AliceMilshtein
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@kingthorin
Copy link
Member

I haven't had a detailed look but I did notice that some new classes have 2023 license headers 😉

@kingthorin kingthorin marked this pull request as draft May 7, 2025 11:33
@psiinon
Copy link
Member

psiinon commented May 9, 2025

Just started playing with the examples in the dev add-on :)
They are all under /api/openapi which is really for OpenAPI related content.
I think they would make more sense being under something like /auth, /auth/totp or /totp.

@psiinon
Copy link
Member

psiinon commented May 9, 2025

I also noticed that in many (all) cases pressing RETURN did not submit the TOTP token. Was that deliberate? Most reasonable web apps I've used do accept RETURN as submit, but I can definitely see the point of having some that dont work in that way.

@psiinon
Copy link
Member

psiinon commented Jun 6, 2025

@AliceMilshtein this PR still has conflicts

* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.zaproxy.addon.dev.auth.totp.simpleAuthTotpBlankCodeVuln;
Copy link
Member

Choose a reason for hiding this comment

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

I would argue that TOTP is not simpleAuth 😉 So maybe packages like totpBlankCodeVuln ?

import org.zaproxy.addon.dev.TestProxyServer;
import org.zaproxy.addon.network.server.HttpMessageHandlerContext;

public class OpenApiWithBlankOtpLoginPage extends TestPage {
Copy link
Member

Choose a reason for hiding this comment

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

These classes are nothing to do with OpenApi 😁

@psiinon
Copy link
Member

psiinon commented Jun 6, 2025

I fixed the conflict locally and had a go with the test apps.
With http://localhost:9091/auth/totp/simple-auth-otp-blank-code-vuln/ I submitted the creds but got an error logged:
/

Ignore that - I hadnt updated the authhelper 😁


if (webSessionBlankCode) {
buildAlert(
"Blank Passcode Vulnerability",
Copy link
Member

Choose a reason for hiding this comment

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

All text shown to the user should be i18n'ed. Use code like Constant.messages.getString(MESSAGE_PREFIX + "soln");

kingthorin pushed a commit to kingthorin/cla that referenced this pull request Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants