Q1 2025 Web3 Security ReportAccess control failures led to $1.63 billion in losses
Discover report insights
  • Hacken
  • Audits
  • zetachain
  • [dApp] ZetaChain / Snap Audit / Jul2024
ZetaChain logo

ZetaChain

Audit name:

[dApp] ZetaChain / Snap Audit / Jul2024

Date:

Aug 21, 2024

Table of Content

Introduction
Audit Summary
System Overview
Findings
Appendix 1. Severity Definitions
Appendix 2. Scope
Disclaimer

Want a comprehensive audit report like this?

Introduction

We express our gratitude to the ZetaChain team for the collaborative engagement that enabled the execution of this dApp Security Assessment.

Zetachain is a blockchain platform that aims to provide a seamless and secure way for users to interact with decentralized applications (dApps) and services. They focus on enhancing the interoperability and scalability of blockchain networks, ensuring high performance and security.

Document

NamedApp Code Review and Security Analysis Report for ZetaChain
Audited ByStephen Ajayi
Approved ByStephen Ajayi
Websitehttps://www.zetachain.com
Changelog30/07/2024 - Final Report
Platform[Metamask Snap ]
Language[TypeScript, JavaScript]
Tags[ dApp, Snap ]
Methodologyhttps://hackenio.cc/dApp_methodology

Review Scope

Repositoryhttps://github.com/1337-ishaan/zetalink
Commit619f27913c72a1f46d713cbf7c4faec41d6db04f

Audit Summary

15Total Findings
15Resolved
0Accepted
0Mitigated

The system users should acknowledge all the risks summed up in the risks section of the report.

Documentation quality

  • Presence of README files in the main directories provides an overview of the packages and their purposes.

  • Clear configuration files (tsconfig.json, .eslintrc.js, .prettierrc.js) that outline the setup and rules for the project.

  • Enhance the README with detailed instructions on how to set up and run the project, including installation steps and usage examples..

Code quality

  • The codebase uses TypeScript, which provides static type checking, reducing runtime errors and improving code quality.

  • Presence of ESLint and Prettier configurations ensures consistent coding style and helps in maintaining clean code.

  • The code is organized into modules (e.g., constants, functions) which promotes reusability and maintainability.

  • Includes unit tests (index.test.ts), indicating a focus on test-driven development and code reliability.

  • Improve error handling mechanisms to gracefully manage unexpected situations and provide meaningful feedback to users.

  • Increase inline comments and documentation within the code to explain complex logic and ensure that new developers can easily understand the codebase.

System Overview

Zetachain is a blockchain platform that aims to provide a seamless and secure way for users to interact with decentralized applications (dApps) and services. They focus on enhancing the interoperability and scalability of blockchain networks, ensuring high performance and security.

What Zetachain Does:

  1. Interoperability Solutions: Enables seamless communication between different blockchain networks, allowing for cross-chain transactions and interactions.

  2. Scalability Enhancements: Implements advanced consensus mechanisms and sharding techniques to improve transaction throughput and reduce latency.

  3. Security Measures: Employs robust security protocols to protect user data and prevent malicious attacks on the network.

  4. Developer Support: Provides comprehensive tools and documentation to support developers in building and deploying dApps on their platform.

Snap Overview

The ZeTrax Snap package is a TypeScript-based project designed for integration with Metamask, incorporating multiple components for configuration, source code, testing, documentation, and web interface.

Key Components

Root Directory Files:

  • .gitignore: Specifies files and directories to be ignored by Git.

  • package-lock.json and package.json: Define project dependencies and their versions, ensuring consistency across environments.

  • .prettierrc.js: Configuration for code formatting with Prettier.

  • .nvmrc: Node Version Manager configuration for specifying the Node.js version.

  • .eslintrc.js: Linting configuration to enforce code quality.

  • tsconfig.json: TypeScript configuration file for compiler options.

  • LICENSE.MIT0: The license file specifying the terms under which the code can be used.

  • .yarn/releases/yarn-3.2.1.cjs: Yarn release file.

  • .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs and @yarnpkg/plugin-workspace-tools.cjs: Yarn plugins for additional functionalities.

  • .github/workflows/: Contains GitHub Actions workflows for CI/CD.

  • .vscode/settings.json: VS Code settings to standardize the development environment.

Snap Package:

  • snap.config.ts: Configuration settings specific to the snap package.

  • snap.manifest.json: Defines the snap’s metadata, including permissions and initial files to be included.

  • src/index.ts: Main entry point for the snap package.

  • src/index.test.ts: Unit tests for the main functionality.

  • src/constants/index.ts: Defines constants used throughout the project.

  • src/functions/index.ts: Utility functions used across the codebase.

  • README.md: Overview and instructions for the snap package.

  • jest.config.js: Configuration for running tests with Jest.

  • scripts/install-chrome.sh: Script for installing Chrome, potentially for end-to-end testing.

Site Package:

  • gatsby-config.ts: Configuration file for the Gatsby site.

  • .env.local and .env.production.dist: Environment variable files for local development and production.

  • gatsby-browser.tsx and gatsby-ssr.tsx: Gatsby files for browser and server-side rendering configurations.

  • src/pages/index.tsx: Main entry point for the site’s homepage.

  • src/assets/: Contains various SVG assets used in the site.

  • README.md: Overview and instructions for the site package.

  • package.json: Define project dependencies specific to the site package.

  • .eslintrc.js: Linting configuration to enforce code quality.

Findings

Code
Title
Status
Severity
F-2024-4470Insecure Private Key Handling
fixed

High
F-2024-4469Insufficient Origin Validation
fixed

Low
F-2024-4468Overly Broad Permissions
fixed

Low
F-2024-4458Vulnerable Dependencies
fixed

Low
F-2024-4410Improper Input Sanitization
fixed

Low
F-2024-4467Missing Explicit Strict Type-Checking Options
fixed

Observation
F-2024-4466Strict Null Checks Not Explicitly Enabled
fixed

Observation
F-2024-4464 Missing Author Information in Package Metadata
fixed

Observation
F-2024-4462Potential for Using Outdated Node.js Version
fixed

Observation
F-2024-4461Imprecise Dependency Versioning
fixed

Observation
1-10 of 15 findings

Protect your dApp with insights like these.

Appendix 1. Severity Definitions

Severity

Description

Critical
These issues present a major security vulnerability that poses a severe risk to the system. They require immediate attention and must be resolved to prevent a potential security breach or other significant harm.

High
These issues present a significant risk to the system, but may not require immediate attention. They should be addressed in a timely manner to reduce the risk of the potential security breach.

Medium
These issues present a moderate risk to the system and cannot have a great impact on its function. They should be addressed in a reasonable time frame, but may not require immediate attention.

Low
These issues present no risk to the system and typically relate to the code quality problems or general recommendations. They do not require immediate attention and should be viewed as a minor recommendation.
  • Severity

    Critical

    Description

    These issues present a major security vulnerability that poses a severe risk to the system. They require immediate attention and must be resolved to prevent a potential security breach or other significant harm.

    Severity

    High

    Description

    These issues present a significant risk to the system, but may not require immediate attention. They should be addressed in a timely manner to reduce the risk of the potential security breach.

    Severity

    Medium

    Description

    These issues present a moderate risk to the system and cannot have a great impact on its function. They should be addressed in a reasonable time frame, but may not require immediate attention.

    Severity

    Low

    Description

    These issues present no risk to the system and typically relate to the code quality problems or general recommendations. They do not require immediate attention and should be viewed as a minor recommendation.

Appendix 2. Scope

The scope of the project includes the following files from the provided repository:

Scope Details

Repositoryhttps://github.com/1337-ishaan/zetalink
Commit619f27913c72a1f46d713cbf7c4faec41d6db04f

Assets in Scope

Metamask Snap Codebase - Metamask Snap Codebase

Disclaimer