> For the complete documentation index, see [llms.txt](https://zokyo-auditing-tutorials.gitbook.io/zokyo-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zokyo-auditing-tutorials.gitbook.io/zokyo-tutorials/tutorial-38-eigen-layer/nonreentrant-vulnerability-in-eigenlayer-withdrawals.md).

# nonReentrant Vulnerability in EigenLayer Withdrawals

**Overview of the Vulnerability**

In decentralized systems, reentrancy vulnerabilities are a common security concern. Reentrancy occurs when a contract's function is called while it is still in execution, potentially allowing malicious actors to manipulate the state or perform unintended actions. While the **nonReentrant** modifier is used to protect against reentrancy attacks, there are scenarios where reentrancy is necessary for the proper functioning of a contract, especially in the context of cross-chain operations or complex workflows like **EigenLayer withdrawals**.

This type of vulnerability arises when the **nonReentrant** modifier is applied too broadly, preventing legitimate operations that require reentrancy. In the case of EigenLayer, the **OperatorDelegator contract** uses the **nonReentrant** modifier in its `receive()` function, which blocks ETH withdrawals. This leads to withdrawals being permanently stuck, as the contract prevents the reentrancy required for successfully processing these transactions.

In this tutorial, we will generalize this vulnerability to explain how improper application of the **nonReentrant** modifier can cause critical functionality to fail, particularly in scenarios involving multi-step operations like asset withdrawals in cross-chain or multi-contract systems such as EigenLayer.\ <br>

#### How the Vulnerability Occurs in EigenLayer Withdrawals

1. **Initiating Withdrawals in EigenLayer**: In EigenLayer, users can stake assets (including ETH) across multiple strategies. When a user initiates a withdrawal, the **OperatorDelegator** contract is responsible for processing the queued withdrawals and returning the assets to the user. This process involves multiple steps, and for ETH withdrawals, reentrancy is required to complete the transaction flow between different contracts (e.g., the **EigenPod** and **OperatorDelegator**).
2. **Blocking Reentrancy in the Receive Function**: The `receive()` function in the **OperatorDelegator** contract is called during ETH withdrawals. However, because the **nonReentrant** modifier is applied to this function, it prevents the contract from handling the reentrant call that is needed to complete the ETH withdrawal. This leads to the withdrawal transaction being permanently stuck.
3. **Permanent Stuck Withdrawals**: Since ETH withdrawals rely on a reentrant call to complete the process, the **nonReentrant** modifier effectively blocks the withdrawal of any ETH from EigenLayer. As a result, users cannot withdraw their ETH, and the assets remain stuck in the contract indefinitely.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://zokyo-auditing-tutorials.gitbook.io/zokyo-tutorials/tutorial-38-eigen-layer/nonreentrant-vulnerability-in-eigenlayer-withdrawals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
