Skip to content

Conversation

@0xrajath
Copy link
Collaborator

@0xrajath 0xrajath commented Sep 17, 2025

Motivation:

Fixing a bug where a random actor could permissionlessly call TaskMailbox::submitResult with an old cert+result combination (as long as the cert is not stale) but for a completely different task directed at the same operator set in the TaskMailbox. This could lead to DoS of the taskCreator.

Modifications:

The messageHash of the cert now is keccak256(abi.encode(taskHash, result)) instead of just keccak256(result). This ensures that the messageHash is applicable only for a specific task and can't be replayed across tasks.

Result:

Fixes SigmaPrime: ELHG-02 finding.

@0xrajath 0xrajath self-assigned this Sep 17, 2025
@0xrajath 0xrajath added ⚖️ Audit Fix Audit-related fixes. ⌛ Hourglass Hourglass, a task-based AVS framework labels Sep 17, 2025
@0xrajath 0xrajath marked this pull request as ready for review September 17, 2025 21:40
Copy link

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

This PR fixes a security vulnerability where certificates could be replayed across different tasks directed at the same operator set. The fix changes the message hash from being based solely on the result to including both the task hash and result, preventing cross-task certificate replay attacks.

  • Updates message hash calculation to include task hash in addition to result data
  • Adds new test cases to verify certificate replay attacks are prevented
  • Updates all existing test helper functions and test cases to use the new message hash format

Reviewed Changes

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

File Description
src/contracts/avs/task/TaskMailbox.sol Implements new getMessageHash function and updates certificate verification to use task-specific message hashes
src/contracts/interfaces/ITaskMailbox.sol Adds interface declaration for the new getMessageHash function
src/test/unit/TaskMailboxUnit.t.sol Updates test helper functions and adds comprehensive test coverage for certificate replay prevention

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

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

One comment

@0xrajath 0xrajath merged commit 6ddd627 into main Sep 18, 2025
15 checks passed
@0xrajath 0xrajath deleted the rajath/replay-tasks branch September 18, 2025 20:02
0xrajath added a commit to Layr-Labs/eigenlayer-middleware that referenced this pull request Sep 18, 2025
**Motivation:**

Bumping up the core submodule to pull in the following changes:
Layr-Labs/eigenlayer-contracts#1629

**Modifications:**

* Latest `eigenlayer-contracts` changes

**Result:**

Fixes SigmaPrime: `ELHG-02` finding.
hashmap0x added a commit to hashmap0x/eigenlayer-middleware that referenced this pull request Sep 23, 2025
**Motivation:**

Bumping up the core submodule to pull in the following changes:
Layr-Labs/eigenlayer-contracts#1629

**Modifications:**

* Latest `eigenlayer-contracts` changes

**Result:**

Fixes SigmaPrime: `ELHG-02` finding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚖️ Audit Fix Audit-related fixes. ⌛ Hourglass Hourglass, a task-based AVS framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants