-
-
Notifications
You must be signed in to change notification settings - Fork 255
Address potential classloader performance issues in JS scripts #504
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
|
Note I used |
|
New Issues (5)Checkmarx found the following issues in this Pull Request
Use @Checkmarx to reach out to us for assistance. Just send a PR comment with Examples: |
Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
39d4e87 to
80916f9
Compare
|
The CX failure is unrelated to the changes. |
| @@ -1,12 +1,13 @@ | |||
| const HtmlParameter = Java.type("org.parosproxy.paros.network.HtmlParameter"); | |||
| const URL_TYPE = org.parosproxy.paros.network.HtmlParameter.Type.url; | |||
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.
Why not Java.type usage?
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 wasn't sure if it needed it. I should have commented asking.
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.
It does not need it, but for consistency and good practices.
| // This script needs Diff add-on | ||
|
|
||
| var DiffTool = Java.type("org.zaproxy.zap.extension.diff.diff_match_patch"); | ||
| const DiffTool = Java.type("org.zaproxy.zap.extension.diff.diff_match_patch"); |
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.
Revert.
| // Use a regex to extract the evidence from the response header | ||
| var regex = new RegExp("^HTTP.*" + code); |
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 unrelated changes should have their respective note in the changelog.
| */ | ||
| function appliesToHistoryType(historyType) { | ||
| // For example, to just scan spider messages: | ||
| // return historyType == org.parosproxy.paros.model.HistoryReference.TYPE_SPIDER; |
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 should be updated as well.
| // if they don't already have a tag that starts with TAG_PREFIX as defined below. | ||
| // Author: kingthorin | ||
| // 20160207: Initial release | ||
| // 20251212: Maintenance changes |
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.
What does this add?
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.
🤷♂️ was just trying to be consistent, happy to drop it (them?)
| // released under the Apache v2.0 license. | ||
| //You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
| //Author : @haseebeqx | ||
| const CONTENT_TYPE = Java.type( |
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'd have expected the Java.type on the HttpHeader (more common usage and avoids loading the class more than once like in the xml script).



No description provided.