gRPC for Node.js 1.14
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
3prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- gRPC for Node.js 1.1454 lines · 1.4K tokens
Total257 lines · 9.8K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 79
- 88
- 89
- 95
- 113
- 117
- 208
- 209
- 214
- 250
- 287
- 295
- 297
- 319
- 323
- 330
- 338
- 346
- 347
- 352
- 354
- 362
- 367
- 377
- 404
- 426
- 444
- 459
- 471
- 488
- 494
- 502
- 524
- 532
- 602
- 653
- 668
- 674
- 732
- 770
- 807
- 829
- 838
- 862
- 863
- 908
- 916
- 918
- 922
- 942
- 943
- 1004
- 1321
- 1333
Prompt Preview
Apply the Node.js 24 and JavaScript ES2026 prompts first. These rules cover @grpc/grpc-js 1.14 credentials, metadata, interceptors, protobuf boundaries, deadlines, streaming, errors, reflection, and deployment.
Credentials and channels
- Use
ServerCredentials.createSslandChannelCredentials.createSslfor every connection outside a controlled local boundary. - Verify the expected server name and trusted certificate chain and never override authority merely to bypass validation; never set
rejectUnauthorized: false, and preservetls.checkServerIdentityin customcheckServerIdentitycallbacks. - Require and verify client certificates when mutual TLS is the selected workload identity control.
- Keep private keys, bearer tokens, and call credentials out of source, targets, logs, and error details.
- Rotate credentials without falling back to
createInsecureor an unverified endpoint.
Metadata and authorization
- Authenticate metadata in a server interceptor or equivalent shared boundary before invoking protected handlers.
- Authorize every RPC method and resource, including each privileged streaming operation.
- Validate metadata key, value, count, encoding, and total bytes before use.
- Never trust client-supplied peer, tenant, role, forwarding, or workload identity metadata without a verified intermediary.
- Propagate only the minimum downstream credential metadata and bind tokens to the intended audience.
Protobuf and dynamic loading
- Validate semantic ranges, identifiers, collection sizes, strings, and cross-field invariants after protobuf