Public setAccess function bypasses business logic validation enabling direct vault manipulation
The setAccess function on ERC4908 is declared public, letting any address modify vault access controls directly and create state inconsistencies with the higher-level KnowledgeMarketV2 subscription tracking.
Description
The setAccess function is declared as public, allowing any address to directly manipulate access control settings for any resource ID, bypassing the intended business logic and state management implemented in the higher-level KnowledgeMarketV2 contract.
Vulnerable Scenario:
The following steps help understand the issue:
- Alice creates a premium knowledge vault
"alice-course-123"and sets up a paid subscription through the platform. - Bob identifies Alice's vault ID and calls
setAccess("alice-course-123", 0, 0, address(0), 0)directly on theERC4908contract. - Bob's call bypasses all validation and state management in
setSubscription, making Alice's premium content free. - The platform's subscription tracking remains unchanged, creating inconsistency between business logic state and access control state.
- Users can now mint access NFTs for free while the platform still shows Alice's original subscription settings.
Impact
Enables direct manipulation of vault access controls while bypassing business logic validation and state management, creating inconsistencies between the platform's subscription tracking and actual access permissions, and allowing attackers to undermine vault monetization without updating associated metadata.
Recommendation
Change the setAccess function visibility from public to internal to prevent direct external calls and force all access control modifications to go through the validated business logic layer:
function setAccess(string calldata resourceId,uint256 price,uint32 expirationDuration,address coOwner,uint32 splitFee) internal { // Changed from public to internal_setAccess(msg.sender, resourceId, price, expirationDuration, coOwner, splitFee);}
Resolution
Ipal Network: Confirmed. We agreed with the recommendation and have updated the setAccess function's visibility from public to internal.
Zealynx: Fixed. The setAccess function visibility changed from public to internal, preventing direct external manipulation and forcing all access control changes through proper business logic validation.

