-
-
Notifications
You must be signed in to change notification settings - Fork 745
[WIP] Totp Active Scan Rules #6255
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
base: main
Are you sure you want to change the base?
Conversation
…rule to check if random passcode meeting format will give access
|
All contributors have signed the CLA ✍️ ✅ |
|
Great job, no security vulnerabilities found in this Pull Request |
…ntication with blank code vulnerability
… work with new version changes
… 3 incorrect codes entered
| private AuthRequestDetails authReq; | ||
| private HttpMessage fallbackMsg; | ||
| private int firstHrefId; | ||
| private List<HttpMessage> httpMessages = new ArrayList<>(); |
There was a problem hiding this comment.
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.
There was a problem hiding this 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; | |||
There was a problem hiding this comment.
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 😁
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All strings should be i18ned, e.g. as per https://github.com/zaproxy/zap-extensions/blob/main/addOns/ascanrulesAlpha/src/main/java/org/zaproxy/zap/extension/ascanrulesAlpha/ExampleFileActiveScanRule.java#L67
| } | ||
| @Override | ||
| public int getCategory() { | ||
| return Category.INFO_GATHER; |
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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
|
The build is failing due to formatting issues. |
| @Override | ||
| public String getSolution() { | ||
| return "N/A"; | ||
| } | ||
| @Override | ||
| public String getReference() { | ||
| return "N/A"; | ||
| } |
There was a problem hiding this comment.
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
…owserBasedAuthenticationMethod to remove false positive issues
…flow for active scan rules
|
I have read the CLA Document and I hereby sign the CLA |
|
I haven't had a detailed look but I did notice that some new classes have 2023 license headers 😉 |
|
Just started playing with the examples in the dev add-on :) |
|
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. |
|
@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; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 😁
|
I fixed the conflict locally and had a go with the test apps. |
|
|
||
| if (webSessionBlankCode) { | ||
| buildAlert( | ||
| "Blank Passcode Vulnerability", |
There was a problem hiding this comment.
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");

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
./gradlew spotlessApplyfor code formattingFor more details, please refer to the developer rules and guidelines.