> For the complete documentation index, see [llms.txt](https://reports.immunefi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reports.immunefi.com/anvil-letters-of-credit/36970-sc-insight-missing-_disableinitializer-implementation.md).

# #36970 \[SC-Insight] Missing \`\_disableInitializer()\` implementation

**Submitted on Nov 21st 2024 at 07:59:06 UTC by @FaisalAli19 for** [**Audit Comp | Anvil: Letters of Credit**](https://immunefi.com/audit-competition/audit-comp-anvil-letters-of-credit)

* **Report ID:** #36970
* **Report Type:** Smart Contract
* **Report severity:** Insight
* **Target:** <https://github.com/AcronymFoundation/anvil-contracts/blob/main/contracts/LetterOfCredit.sol>
* **Impacts:**
  * Missing \`\_disableInitializer()\` implementation

## Description

## Brief/Intro

The \`LetterOfCredit.sol\` contract uses the Initializable module and is missing a call to \_disableInitializers() in its constructor. This function is critical to ensure that the implementation contract is locked and cannot be initialized.

## Vulnerability Details

The implementation contract is missing a call to \`\_disableInitializers()\` in its constructor. This function is critical to ensure that the implementation contract is locked and cannot be initialized. If an attacker successfully initializes the implementation contract, they could potentially gain unauthorized control over it, which might impact proxy contracts pointing to the implementation.

## Impact Details

An uninitialized implementation contract poses a significant security risk:

1. Unauthorized Access: Attackers could initialize the implementation contract, setting themselves as the contract owner or manipulating state variables.
2. Proxy Impact: Malicious control over the implementation could indirectly affect proxy contracts relying on it.

## References

Please check the Initializing the Implementation Contract section. <https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable>

## Proof of Concept

<https://github.com/AcronymFoundation/anvil-contracts/blob/b03f034929b4c0972c8d81f2d0d33dd730056aa2/contracts/LetterOfCredit.sol#L157>

\`\`\`solidity constructor() initializer {} \`\`\`


---

# 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://reports.immunefi.com/anvil-letters-of-credit/36970-sc-insight-missing-_disableinitializer-implementation.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.
