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

Update MultipleHtmlTags.bambda #41

Conversation

BugBountyzip
Copy link
Contributor

@BugBountyzip BugBountyzip commented Dec 13, 2023

image

``
An exception was thrown while running your Bambda for item number 521

java.lang.NullPointerException: Cannot invoke "burp.api.montoya.http.message.responses.HttpResponse.statedMimeType()" because the return value of "burp.api.montoya.proxy.ProxyHttpRequestResponse.response()" is null
at burp.Bambda.matches(Bambda.java:42)
``

The problem initially encountered with the Bambda script involved a NullPointerException. This exception was thrown because the script attempted to invoke the statedMimeType() method on a HttpResponse object that was null. This issue typically occurs when the script is trying to process an HTTP transaction (request/response pair) where the response part is missing or not properly captured.

To address this issue, the script was modified to include a check ensuring that both the request and response objects are not null before proceeding with the processing. This ensures that the script only attempts to process complete HTTP transactions where both the request and response are available.

also an enhancement was made to the script to detect multiple </html> tags in HTML responses. This was done by counting the occurrences of </html> in the response body and highlighting the transactions where more than one occurrence was found. This feature is useful for identifying responses that may contain improperly structured HTML, which could be indicative of potential issues or vulnerabilities.

Thank you

Bambda Contributions

  • Bambda has a valid header, featuring an @author annotation and suitable description
  • Bambda compiles and executes as expected
  • Only .bambda files have been added or modified (README.md files are automatically updated / generated after PR merge)

BugBountyzip and others added 2 commits December 13, 2023 17:05
The problem initially encountered with the Bambda script involved a `NullPointerException`. This exception was thrown because the script attempted to invoke the `statedMimeType()` method on a `HttpResponse` object that was null. This issue typically occurs when the script is trying to process an HTTP transaction (request/response pair) where the response part is missing or not properly captured.

To address this issue, the script was modified to include a check ensuring that both the request and response objects are not null before proceeding with the processing. This ensures that the script only attempts to process complete HTTP transactions where both the request and response are available. 

also an enhancement was made to the script to detect multiple `</html>` tags in HTML responses. This was done by counting the occurrences of `</html>` in the response body and highlighting the transactions where more than one occurrence was found. This feature is useful for identifying responses that may contain improperly structured HTML, which could be indicative of potential issues or vulnerabilities.

Thank you
Copy link
Collaborator

@PortSwiggerWiener PortSwiggerWiener left a comment

Choose a reason for hiding this comment

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

Many thanks for your bug fix!

Looks good 👍

Copy link
Contributor

@ps-porpoise ps-porpoise left a comment

Choose a reason for hiding this comment

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

👍 Looks good!

@ps-porpoise ps-porpoise merged commit 13dbd19 into PortSwigger:main Dec 13, 2023
1 check failed
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