Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 1.02 KB

SWC-100.md

File metadata and controls

18 lines (11 loc) · 1.02 KB

Title

Function Default Visibility

Relationships

CWE-710: Improper Adherence to Coding Standards

Description

Functions that do not have a function visibility type specified are public by default. This can lead to a vulnerability if a developer forgot to set the visibility and a malicious user is able to make unauthorized or unintended state changes.

Remediation

Functions can be specified as being external, public, internal or private. It is recommended to make a conscious decision on which visibility type is appropriate for a function. This can dramatically reduce the attack surface of a contract system.

References