Skip to content

feat(gateway): rate-limit confidential relay ingress [CL112-03]#23185

Open
nadahalli wants to merge 1 commit into
developfrom
tejaswi/priv-436-relay-ingress-rate-limit
Open

feat(gateway): rate-limit confidential relay ingress [CL112-03]#23185
nadahalli wants to merge 1 commit into
developfrom
tejaswi/priv-436-relay-ingress-rate-limit

Conversation

@nadahalli

Copy link
Copy Markdown
Contributor

Closes the ingress half of the confidential relay gateway DoS finding (Sigma Prime
CL112-03 / PRIV-436). HandleJSONRPCUserMessage forwarded every inbound JSON-RPC
request to all DON nodes with no request-side rate limiting; only node responses
were limited. A single unauthenticated caller could amplify one request into
per-node attestation verification and a capabilities-registry lookup.

Adds a global ingress limiter (GatewayConfidentialRelayUserRate, default
100rps/burst 10) checked at the top of HandleJSONRPCUserMessage before fan-out,
closed in Close(), plus a test asserting a throttled request never reaches the DON.
It mirrors the two existing relay limiters (read via MakeRateLimiter, so operator
overrides flow through the limits framework).

Deliberately out of scope

Gateway-side owner/attestation validation. Relay requests carry no JWT (unlike the
vault handler); owner binding comes from F+1 signature verification at the relay DON
nodes (PRIV-433), not the gateway. Duplicating that crypto at ingress would not
reduce the amplification and would need the gateway to hold the DON signer set.

Depends on

smartcontractkit/chainlink-common#2268 (adds the setting). CI here will fail to
compile until #2268 merges and this branch bumps chainlink-common. Keeping this
draft until then.

HandleJSONRPCUserMessage forwarded every inbound request to all DON nodes with no
request-side rate limiting, so one unauthenticated caller could amplify a single
request into per-node attestation verification and a capabilities-registry lookup.
Only node responses were rate limited.

Add a global ingress limiter (cresettings.GatewayConfidentialRelayUserRate,
default 100rps/burst 10) checked before fan-out, plus a test asserting a throttled
request never reaches the DON.

Deliberately out of scope: gateway-side owner/attestation validation. Relay requests
carry no JWT (unlike vault); owner binding comes from F+1 signature verification at
the relay DON nodes (PRIV-433), not the gateway, so duplicating that crypto at
ingress would not reduce the amplification.

PRIV-436.
@nadahalli
nadahalli marked this pull request as ready for review July 21, 2026 10:15
@nadahalli
nadahalli requested a review from a team as a code owner July 21, 2026 10:15
@github-actions

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@github-actions

Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@cl-sonarqube-production

Copy link
Copy Markdown

@trunk-io

trunk-io Bot commented Jul 21, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant