Skip to content

Verify enclave config against onchain DON in confidentialrelay handler (PRIV-458)#22516

Open
nadahalli wants to merge 1 commit into
developfrom
tejaswi/priv-458-relay-config-verify
Open

Verify enclave config against onchain DON in confidentialrelay handler (PRIV-458)#22516
nadahalli wants to merge 1 commit into
developfrom
tejaswi/priv-458-relay-config-verify

Conversation

@nadahalli
Copy link
Copy Markdown
Contributor

Closes Sigma Prime CL112-01 on the relay-DON path.

The confidentialrelay handler now compares the attested EnclaveConfig
in every incoming SecretsRequestParams and CapabilityRequestParams
against the local node's WorkflowDON membership and fault tolerance,
after Nitro attestation validation succeeds.

The relay DON runs on the same nodes as the workflow DON, so
localNode.WorkflowDON.Members is the right comparison target. LocalNode
is an O(1) in-memory map lookup populated by the registry syncer on a
~12s tick, so the check stays off the RPC hot path. Up to ~12s
staleness applies during DON membership rotations and is acceptable
given how rare those events are.

Bumps chainlink-common to v0.11.2-0.20260518112011-40a8e4cedaa8 to pick
up the EnclaveConfig field on confidentialrelay request params:

Companion PRs (Stage 2 of PRIV-458):

Tests cover match-accepts, F mismatch, signers-count mismatch, signer
value mismatch, order-independent comparison, and the secrets-get
path. Existing handler tests updated to fill EnclaveConfig in fixtures
with a matching WorkflowDON.Members in the mock registry.

Jira: https://smartcontract-it.atlassian.net/browse/PRIV-458

…r (PRIV-458)

The handler now compares the attested EnclaveConfig in every incoming
SecretsRequestParams and CapabilityRequestParams against the local
node's WorkflowDON membership and fault tolerance, after Nitro
attestation validation succeeds. Closes Sigma Prime CL112-01 on the
relay-DON path.

The relay DON runs on the same nodes as the workflow DON, so
localNode.WorkflowDON.Members is the right comparison target. LocalNode
is an O(1) in-memory map lookup populated by the registry syncer on a
~12s tick, so the check stays off the RPC hot path. Up to ~12s
staleness applies during DON membership rotations and is acceptable
given how rare those events are.

Tests cover match-accepts, F mismatch, signers-count mismatch, signer
value mismatch, order-independent comparison, and the secrets-get
path. Existing tests updated to fill EnclaveConfig in fixtures with
a matching WorkflowDON.Members in the mock registry.

Bumps chainlink-common to v0.11.2-0.20260518112011-40a8e4cedaa8 to pick
up the EnclaveConfig field on confidentialrelay request params
(smartcontractkit/chainlink-common#2063).

Companion PRs:
- smartcontractkit/confidential-compute#329 (pool.go-side check).
- smartcontractkit/chainlink-common#2063 (field on params).
- smartcontractkit/confidential-compute#330 (enclave fills field).
Copilot AI review requested due to automatic review settings May 18, 2026 12:42
@nadahalli nadahalli requested review from a team as code owners May 18, 2026 12:42
@github-actions
Copy link
Copy Markdown
Contributor

👋 nadahalli, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

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

@github-actions
Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Risk Rating: MEDIUM — changes add new validation in the confidential relay request handling path (security hardening) and bump a shared dependency (chainlink-common).

This PR hardens the confidential relay handler by verifying that the attested EnclaveConfig in incoming requests matches the node’s locally-synced onchain WorkflowDON membership and fault tolerance, addressing Sigma Prime CL112-01 (PRIV-458).

Changes:

  • Add relay-side EnclaveConfig vs WorkflowDON verification for both SecretsGet and CapabilityExec flows.
  • Bump github.com/smartcontractkit/chainlink-common to pick up the new EnclaveConfig field on request params.
  • Update handler tests/fixtures and add dedicated tests for EnclaveConfig verification (match, mismatches, order-independence, secrets-get coverage).

Targeted areas requiring scrupulous human review:

  • verifyEnclaveConfigMatchesDON: confirm the chosen onchain reference (localNode.WorkflowDON) is correct for all deployments/rotations and that the comparison logic matches the intended security model (especially around signer identity representation).
  • Request-path behavior during DON membership rotations / registry staleness: ensure the new rejection behavior is operationally acceptable for the gateway/enclave interaction.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
go.mod Bumps chainlink-common to a newer pseudo-version to include EnclaveConfig in request params.
go.sum Updates module sums for the chainlink-common version bump.
core/capabilities/confidentialrelay/handler.go Adds EnclaveConfig verification against locally synced WorkflowDON members/F; hooks it into SecretsGet and CapabilityExec after attestation hash verification.
core/capabilities/confidentialrelay/handler_test.go Updates fixtures to include EnclaveConfig and adds tests covering accept/reject cases and order-independence.
Comments suppressed due to low confidence (1)

core/capabilities/confidentialrelay/handler_test.go:475

  • This struct literal has formatting/indentation issues (EnclaveConfig and the closing brace are misaligned). Please run gofmt (or adjust indentation) to keep formatting consistent and avoid gofmt-check failures.
				params := confidentialrelaytypes.CapabilityRequestParams{
					WorkflowID:   "wf-1",
					Owner:        testOwner,
					ExecutionID:  "32c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce1",
					ReferenceID:  "17",
					CapabilityID: "fail-cap@1.0.0",
					Payload:      base64.StdEncoding.EncodeToString(mustMarshalProto(t, &sdkpb.CapabilityRequest{Id: "fail-cap@1.0.0", Method: "Execute"})),
				EnclaveConfig: testEnclaveConfig(),
				}

// the Nitro attestation binds the request hash, but a malicious host
// can produce a genuinely-attested request over a forged enclave config
// unless we compare the config value against an onchain reference.
if err := h.verifyEnclaveConfigMatchesDON(ctx, params.EnclaveConfig); err != nil {
Comment on lines 333 to 341
params := confidentialrelaytypes.CapabilityRequestParams{
WorkflowID: "wf-1",
Owner: testOwner,
ExecutionID: "32c631d295ef5e32deb99a10ee6804bc4af13855687559d7ff6552ac6dbb2ce1",
ReferenceID: "17",
CapabilityID: "my-cap@1.0.0",
Payload: makeCapabilityPayload(t, map[string]any{"key": "val"}),
EnclaveConfig: testEnclaveConfig(),
}
@cl-sonarqube-production
Copy link
Copy Markdown

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 18, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestAggregator_capabilityExec_dedupesDuplicateSigner Logs ↗︎
TestConfidentialRelayHandler_QuorumWithRealAggregator Logs ↗︎
TestAggregator_quorumUnobtainable Logs ↗︎
TestAggregator_skipsTransportErrorsFromQuorum Logs ↗︎

... and 3 more

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.

2 participants