WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Rough Misty Hawk - ShareManager.isDepositorWhitelisted doesn't check hasWhitelist for whitelistMerkleRoot_. #761

@sherlock-admin4

Description

@sherlock-admin4

Rough Misty Hawk

Medium

ShareManager.isDepositorWhitelisted doesn't check hasWhitelist for whitelistMerkleRoot_.

Summary

    struct ShareManagerStorage {
        /// @notice Address of the vault associated with this ShareManager.
        address vault;
        /// @notice Bitpacked configuration flags controlling global minting, burning, transfers, whitelists and lockups.
        uint256 flags;
        /// @notice Total shares allocated to all accounts (includes pending shares).
        uint256 allocatedShares;
        /// @notice Merkle root for verifying account permissions (used for deposits if whitelist flags are active).
@>      bytes32 whitelistMerkleRoot;
        /// @notice Tracks individual account permissions, blacklist status, and lockup.
        mapping(address account => AccountInfo) accounts;
    }

ShareManager.isDepositorWhitelisted checks whitelistMerkleRoot even though $.flags.hasWhitelist() is false.

Root Cause

https://github.com/sherlock-audit/2025-07-mellow-flexible-vaults/blob/main/flexible-vaults/src/managers/ShareManager.sol#L53-L63

It checks whitelistMerkleRoot_ when $.flags.hasWhitelist() = false.

Internal Pre-conditions

.

External Pre-conditions

.

Attack Path

.

Impact

This can cause DoS because isDepositorWhitelisted checks whitelistMerkleRoot_ even though $.flags.hasWhitelist() = false.

PoC

.

Mitigation

Update code.

if ($.flags.hasWhitelist() == false)
  return true;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions