Submitted by gh8eo
This vulnerability allows an attacker to preemptively set a target address as a vesting account, permanently blocking contract deployments by Factory contracts or other users to that address. Once the address is marked as a vesting account, any deployment attempt stores the contract bytecode in the state without creating a codeHash, rendering the contract permanently inaccessible.
For example, an attacker could target critical ecosystem addresses, such as those planned for LayerZero or Uniswap, and preemptively mark them as vesting accounts. This would effectively orphan the contract bytecode at these addresses, with no way to interact with or access it. The severity is compounded if funds are deployed with the contract, as these would also be irretrievable.
If exploited, this vulnerability allows an attacker to lock up critical addresses by setting them as vesting accounts, resulting in lost contracts with unreachable bytecode and permanently inaccessible funds. For ecosystem-critical contracts or high-value deployments, this could disrupt functionality and lead to substantial, irreversible losses.
The following commit demonstrates the vulnerability through a step-by-step exploit:
Please provide your GitHub handles, and I will grant access to the private repository. For quick reference before access permissions are granted, Ive included a core snippet of the reproduction code below.
There are two potential approaches for patching this vulnerability: a fundamental patch and a more practical one.
The fundamental approach involves completely separating the Cosmos address system from the EVM address system. Currently, the bytes of an EVM address are directly used as Cosmos addresses, allowing them to share state, which enables this vulnerability. By fully decoupling these address systems, this issue could be prevented entirely. However, this would require a major design overhaul and is thus not a realistic solution.
The more practical approach is to disable the Vesting Account feature at the ante handler level. While this would prevent the use of vesting features, it is likely a necessary trade-off for security reasons.
Unique-Divine (Nibiru) confirmed and commented:
Nibiru mitigated:
Status: Mitigation confirmed. 
