Skip to content

[GrantShares] GBA-04 Safe Storage Access #74

Open
@OT-kraftchain

Description

@OT-kraftchain

The safe bridgeVersion method does not use asReadOnly() when accessing storage. In N3, different types of storage access exist, with the ReadOnly Context being the most suitable for read-only methods. Using a read-only context ensures that no unintended or malicious state
modifications can occur. As in the rest of the cases, it is important to follow the Principle of Least Privilege (PoLP) in order to avoid future problems.

Recommendations
• Add asReadOnly() to the storage access of the bridgeVersion method.

References
https://en.wikipedia.org/wiki/Principle_of_least_privilege

Source Code References

return Storage.getInt(context, BRIDGE_VERSION_KEY);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions