Skip to content

Conversation

@kingthorin
Copy link
Member

No description provided.

@kingthorin
Copy link
Member Author

Note I used const in all the changes but didn't change/reduce other use of var. I can I just wasn't sure if it should be the same PR.

@psiinon
Copy link
Member

psiinon commented Dec 12, 2025

Logo
Checkmarx One – Scan Summary & Detailsfc6b0dca-a0ad-49eb-906d-c19efb0bba81

New Issues (5)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
HIGH Last User Is 'root' /docker-wrapper: 10
detailsLeaving the last user as root can cause security risks. Change to another user after running the commands that need privileges
ID: 48tNdC6UziXyOGUccQZn3tPPzi4%3D
LOW MAINTAINER Instruction Being Used /docker-wrapper: 3
detailsThe MAINTAINER instruction sets the Author field of the generated images. The LABEL instruction is a much more flexible version of this and you sh...
ID: nlHBIHIr9RZHoVXOgGxJ9hQCHFA%3D
LOW Unpinned Actions Full Length Commit SHA /codeql.yml: 31
detailsPinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA help...
ID: z89ONTXYaYdPcNUEzfFqPVDqGfU%3D
LOW Unpinned Actions Full Length Commit SHA /codeql.yml: 34
detailsPinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA help...
ID: wmF9HbZcEd4Px83a0Vg%2BO%2F%2B%2B4BU%3D
LOW Unpinned Actions Full Length Commit SHA /codeql.yml: 35
detailsPinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA help...
ID: ivv4LqDvobLaIQBf4po7RJO0z9E%3D

Use @Checkmarx to reach out to us for assistance.

Just send a PR comment with @Checkmarx followed by a natural language request.

Examples: @Checkmarx how are you able to help me? @Checkmarx rescan this PR

Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
@kingthorin kingthorin force-pushed the adjust-java-type-usage branch from 39d4e87 to 80916f9 Compare December 12, 2025 16:53
@kingthorin kingthorin changed the title Address potential classloader performance issues Address potential classloader performance issues in JS scripts Dec 12, 2025
@kingthorin
Copy link
Member Author

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;
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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");
Copy link
Member

Choose a reason for hiding this comment

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

Revert.

Comment on lines -96 to -97
// Use a regex to extract the evidence from the response header
var regex = new RegExp("^HTTP.*" + code);
Copy link
Member

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;
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

What does this add?

Copy link
Member Author

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(
Copy link
Member

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).

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