Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 657 Bytes

20.md

File metadata and controls

10 lines (7 loc) · 657 Bytes

Function Default Visibility

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

https://swcregistry.io/docs/SWC-100