Skip to content

Conversation

@pinalikefruit
Copy link
Contributor

Simple, reproducible attack for missing data validation, to bring in recent content related to the categories of Data Validation and Bridges


- **Whitelist Addresses:** The `socketVault` parameter should not have been an arbitrary address. The contract should maintain a whitelist of trusted vault addresses.

- **Input Validation:** The fix is to validate inputs properly. The function should have required the deposit amount to be greater than zero.
Copy link
Collaborator

@nine-december nine-december Dec 1, 2025

Choose a reason for hiding this comment

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

this check would not protect against the attack.

LYRA_DEPOSIT_WRAPPER.depositToLyra{value: 0}(
    address(USDC),
    ATTACKER, // socketVault: The address to grant approval to.
    false,
    1,        // amount: something greater than the min deposit (would get it back afterwards).
    1,
    address(WETH)
);

and then directly from the ATTACKER, pull the approved tokens.

The issue is fixed by:

  • validating inputs
  • removing that infinite approval using specific-amounts (or, if needed, resetting the approval back to zero at the very end of the call).
  • The worst thing here is the arbitrary targets and parameters allowed by the lack of checks.

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