Flow

Sablier
FoundryDeFi
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Lack of Access Control on tokenURI Function

Summary

The tokenURI function is publicly accessible without access control, allowing any caller to interact with it.

Finding Description

The tokenURI function in FlowNFTDescriptor.sol is marked as external without any restrictions, allowing unrestricted access. While this does not currently present a security risk, it could become problematic if the function’s behavior is extended in the future to rely on sensitive data or generate unique data per user. Lack of access control in such a context could lead to data exposure or misuse by unauthorized parties.

If this function were to generate unique data for different callers, it could potentially expose sensitive information or lead to abuse by unauthorized users querying the function to retrieve or attempt to infer sensitive details.

Vulnerability Details

The vulnerability lies in the lack of access control on the tokenURI function, which is marked as external and accessible by anyone. This configuration is safe under the current implementation but lacks future-proofing if the function’s role expands to include sensitive data.

Impact

The impact is currently low but may escalate to medium or high if this function is extended to include sensitive or user-specific data. Keeping it publicly accessible without restrictions could lead to data leakage or abuse.

Proof of Concept

// Current function is unrestricted and externally accessible
function tokenURI(
IERC721Metadata, /* sablierFlow */
uint256 /* streamId */
) external pure override returns (string memory uri) {
// Current implementation
}

Recommendations

To mitigate potential future risks, consider changing the function to internal or public and restrict it through an access control modifier if sensitive data handling is anticipated.

Updated Code with Access Control

function tokenURI(
IERC721Metadata, /* sablierFlow */
uint256 /* streamId */
) public pure onlyOwner override returns (string memory uri) {
// Implementation
}

By implementing onlyOwner or another suitable access modifier, this approach restricts the function to specific authorized users.

Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.