Skip to content

Allow grpc content types in AlertOnUnexpectedContentTypes script - #528

Open
Shivambakal wants to merge 1 commit into
zaproxy:mainfrom
Shivambakal:Shivambakal-patch-1
Open

Shivambakal wants to merge 1 commit into
zaproxy:mainfrom
Shivambakal:Shivambakal-patch-1

Conversation

@Shivambakal

Copy link
Copy Markdown

Fixes #524. Adds application/grpc, application/grpc+proto, application/grpc-web, application/grpc-web+proto, application/grpc-web-text to expectedTypes in httpsender/AlertOnUnexpectedContentTypes.js. Rationale: grpc is a legitimate binary protocol — an endpoint returning a grpc content type is expected behaviour, not a misconfiguration, so it should not raise an 'unexpected content type' alert. Testing: I did not run the ZAP script harness in this environment — please confirm via CI/review.

Added additional expected content types for gRPC.

Signed-off-by: Shivam bakal <133800834+Shivambakal@users.noreply.github.com>
@psiinon

psiinon commented Nov 25, 2026

Copy link
Copy Markdown
Member

Logo
Checkmarx One – Scan Summary & Details – c5826069-6e00-4bcc-8004-f463c3930fd5


New Issues (10 out of 10) Checkmarx found the following issues in this Pull Request

Severity: 1 High · 3 Medium · 6 Low

# Severity Issue Source File / Package Checkmarx Insight
1 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
2 MEDIUM Hardcoded_Password_in_Connection_String other/api/sdlc-integration/core/scan_module/scan.py: 219
detailsThe application contains hardcoded connection details, "PASS: ", at line 219 of /other/api/sdlc-integration/core/scan_module/scan.py. This conn...
Attack Vector
3 MEDIUM Unchecked_Input_for_Loop_Condition standalone/load_context_from_burp.py: 29
detailsMethod at line 29 of /standalone/load_context_from_burp.py obtains user input from load - the range of this value is not validated, and is ev...
Attack Vector
4 MEDIUM Use_of_Broken_or_Risky_Cryptographic_Algorithm payloadgenerator/associated_fields.py: 34
detailsIn , the application protects sensitive data using a cryptographic algorithm, hexdigest, that is considered weak or even trivially broken, in /payl...
Attack Vector
5 LOW Filtering_Sensitive_Logs other/api/sdlc-integration/core/scan_module/scan.py: 243
detailsThe application logs various user events, and in method  writes sensitive user details to debug, in /other/api/sdlc-integration/core/scan_module/...
Attack Vector
6 LOW Filtering_Sensitive_Logs other/api/sdlc-integration/core/scan_module/scan.py: 218
detailsThe application logs various user events, and in method  writes sensitive user details to debug, in /other/api/sdlc-integration/core/scan_module/...
Attack Vector
7 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...
8 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...
9 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...
10 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...

Use @Checkmarx to take action directly from this PR:

  • Rescan the PR

Try it: @Checkmarx how can you help? · @Checkmarx rescan this PR

var pluginid = 100001; // https://github.com/zaproxy/zaproxy/blob/main/docs/scanners.md

var expectedTypes = ["application/octet-stream", "text/plain"];
var expectedTypes = ["application/octet-stream", "text/plain", "application/grpc", "application/grpc+proto", "application/grpc-web", "application/grpc-web+proto", "application/grpc-web-text"];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like it would make more sense to add to the variable immediately below.

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.

AlertOnUnexpectedContentTypes.js reports false positive for application/grpc header

3 participants