Unnecessary and misleading check in implementation()
The proxy's implementation() restricts access to the admin even though the same address is publicly readable through ProxyAdmin and the EIP-1967 storage slot, creating only a false sense of security.
Description
The proxy contract includes a misleading access control check in the implementation() function that serves no practical security purpose:
- In
KnowledgeMarketProxy.sol(line 54), the implementation address is restricted to admin-only access:
require(msg.sender == _getAdmin(), "Only admin can view implementation");
- However, in
ProxyAdmin.sol(line 47), the same implementation address is exposed publicly:
function getProxyImplementation(KnowledgeMarketProxy proxy) external view returns (address) {// We use the implementation getter directly on the proxy (no need to be admin)return proxy.implementation();}
- Additionally, the implementation address is stored in a standardized storage slot (EIP-1967) that anyone can read directly from the blockchain.
This creates a false sense of security and architectural inconsistency. The access control in the proxy is ineffective since the same information is available through multiple public channels.
Impact
Misleading access control that suggests confidentiality where none exists; the implementation address is public anyway via EIP-1967 and the helper.
Recommendation
The recommended solution is to remove the admin-only check from the KnowledgeMarketProxy implementation() function:
function implementation() external view returns (address) {// require(msg.sender == _getAdmin(), "Only admin can view implementation"); // removereturn _getImplementation();}
Since the implementation address is publicly accessible through the ProxyAdmin contract and direct storage-slot queries, the check provides a false sense of security without offering any real protection.
Resolution
Ipal Network: Confirmed. We agreed with the recommendation.
Zealynx: Not Fixed: The admin-only check in the implementation() function remains, but this is purely cosmetic since the implementation address is publicly readable through standard EIP-1967 storage slots anyway.
UPDATE: Fixed.

