gRPC Java 1.83
Last reviewed Oct 10, 2026
Prompt Details
Prompt Composition
2prompts
- Java 25113 lines · 2.8K tokens
- gRPC Java 1.8362 lines · 2.2K tokens
Total175 lines · 5K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 79
- 88
- 89
- 95
- 113
- 117
- 190
- 201
- 208
- 209
- 214
- 295
- 297
- 306
- 319
- 323
- 327
- 338
- 347
- 362
- 367
- 378
- 427
- 470
- 471
- 494
- 502
- 532
- 611
- 653
- 681
- 732
- 770
- 772
- 776
- 789
- 807
- 862
- 863
- 915
- 916
- 918
- 922
- 942
- 1333
Prompt Preview
Apply the Java 25 baseline first. These rules cover gRPC Java 1.83 transport, metadata, interceptors, limits, retries, deadlines, reflection, and streaming.
Transport and identity
- Use
NettyServerBuilder.forPort(port, ServerCredentials)withTlsServerCredentials, or a reviewed TLSSslContextconfigured withGrpcSslContexts;forPort(port)uses a plaintext server factory. - Reject
ManagedChannelBuilder.usePlaintext()andInsecureChannelCredentialsoutside an explicitly protected local transport and never deriveoverrideAuthorityor TLS authority overrides from request input. - Validate peer identity from transport attributes and map certificates or workload credentials to one canonical principal; metadata is not proof of transport identity.
- Require server-name and certificate-chain verification for clients and scope trust roots narrowly instead of accepting all certificates or hostnames.
- On Java 25 with Netty 4.2.0.Final through 4.2.16.Final, which predate the 4.2.17.Final fix, avoid the OpenSSL client path with a plain
X509TrustManager, because it skips hostname verification there; useSslProvider.JDKor a correctly verifyingX509ExtendedTrustManager, and test that trusted certificates for the wrong hostname are rejected. - Rotate keys and certificates without silently downgrading to plaintext, and set
clientAuth(TlsServerCredentials.ClientAuth.REQUIRE)when client certificates are required; test both sides of mTLS.
Metadata, interceptors, and authorization
- Set
maxInboundMetadataSizebelow the Netty server default of 8 KiB where