Skip to content

Commit

Permalink
feat(docs): detectors overview on the index page
Browse files Browse the repository at this point in the history
Closes #20
  • Loading branch information
jubnzv committed Oct 26, 2024
1 parent a625cc2 commit c755672
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 55 deletions.
42 changes: 1 addition & 41 deletions docs/detectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,7 @@ title: Detectors Overview

# Detectors Overview

Misti currently supports 25 detectors designed to identify specific code issues, detect vulnerabilities, and enforce best practices.

## Solved Problems

### TON and Tact Specific
There are language-specific patterns in TON and Tact that may lead to unintended behavior if not handled correctly.

Example detectors:
* [CellOverflow](./detectors/CellOverflow.md)
* [StringReceiversOverlap](./detectors/StringReceiversOverlap.md)
* [EnsurePrgSeed](./detectors/EnsurePrgSeed.md)
* [SuspiciousMessageMode](./detectors/SuspiciousMessageMode.md)

### DoS Attacks
Denial of Service (DoS) and out-of-gas attacks can disrupt the execution of contracts, making them inaccessible or non-functional.

Example detectors:
* [SendInLoop](./detectors/SendInLoop.md)
* [UnboundMap](./detectors/UnboundMap.md)

### Arithmetic Errors
Arithmetic errors in blockchain code can lead to incorrect calculations, potentially causing serious issues such as overflows or underflows.

Example detectors:
* [DivideBeforeMultiply](./detectors/DivideBeforeMultiply.md)

### Optimization
Misti provides various detectors aimed at optimizing code. While these may not identify security vulnerabilities, they help improve project quality by optimizing gas usage and enhancing code readability. These detectors are typically available when running Misti with the `--all-detectors` flag.

Example detectors:
* [OptimalMathFunction](./detectors/OptimalMathFunction.md)
* [PreferAugmentedAssign](./detectors/PreferAugmentedAssign.md)

### Suspicious Patterns
There are numerous suspicious patterns in source code that auditors should pay attention to. These detectors are generally disabled by default but can be enabled during audits to provide deeper insights into the code structure and highlight areas for manual review.

Example detectors:
* [ZeroAddress](./detectors/ZeroAddress.md)
* [InheritedStateMutation](./detectors/InheritedStateMutation.md)

## List of Built-in detectors
## Built-in Detectors

| # | Detector | Severity | Requires Soufflé | Enabled by default |
|----|-----------|-----------|--------------------|---------------------|
Expand Down
9 changes: 8 additions & 1 deletion src/pages/tools/misti/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,18 @@
border-radius: 8px; /* Rounded corners */
padding: 1.5rem; /* Inner padding */
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); /* Subtle shadow for depth */
margin-bottom: 2rem; /* Spacing between boxes */
height: 100%; /* Make all boxes the same height */
display: flex;
flex-direction: column;
}
.rowWithMargin {
margin-bottom: 2rem;
}

.centerButton {
display: flex;
justify-content: center;
}

.featuresTitle {
text-align: left; /* Align text to the left */
Expand Down
111 changes: 98 additions & 13 deletions src/pages/tools/misti/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ import styles from './index.module.css';

export default function Home() {
return (
<Layout
title="Welcome to Misti"
description="The TON Static Analyzer">
<Layout title="Welcome to Misti" description="The TON Static Analyzer">
<header className={styles.heroBanner}>
<div className={styles.textContainer}>
<h1 className={styles.heroTitle}>Misti</h1>
<p className={styles.heroSubtitle}>TON Security Tool</p>
<p className={styles.heroSubtitleSmall}>Detects security issues in TON smart contracts before they reach production</p>
<p className={styles.heroSubtitleSmall}>
Detect security issues in TON smart contracts before they reach
production
</p>
<div className={styles.buttons}>
<a
className="button button--primary button--lg"
href="/tools/misti/docs/">
<a className="button button--primary button--lg" href="/tools/misti/docs/">
Get Started
</a>
</div>
Expand All @@ -26,31 +25,117 @@ export default function Home() {
<div className="container">
<h2 className={styles.featuresTitle}>Misti Overview</h2>
<p className={styles.featuresSummary}>
Misti is a comprehensive security tool designed to identify and prevent vulnerabilities in TON smart contracts. By streamlining the development process and integrating security checks early, Misti ensures your code remains robust and secure.
Misti is a comprehensive security tool designed to identify and
prevent vulnerabilities in TON smart contracts. By streamlining
the development process and integrating security checks early,
Misti ensures your code remains robust and secure.
</p>
<div className="row">
<div className={`${styles.rowWithMargin} row`}>
<div className="col col--4">
<div className={styles.featureBox}>
<h3>🔒 Code Analysis</h3>
<p>Identify and fix potential <a href="/tools/misti/docs/detectors">security flaws and code problems</a> early in the development cycle.</p>
<p>
Identify and fix potential{' '}
<a href="/tools/misti/docs/detectors">
security flaws and code problems
</a>{' '}
early in the development cycle.
</p>
</div>
</div>
<div className="col col--4">
<div className={styles.featureBox}>
<h3>⚙️ CI/CD Integration</h3>
<p><a href="/tools/misti/docs/tutorial/ci-cd">Integrate</a> Misti into your CI/CD pipeline to ensure continuous code quality checks.</p>
<p>
<a href="/tools/misti/docs/tutorial/ci-cd">Integrate</a> Misti
into your CI/CD pipeline to ensure continuous code quality
checks.
</p>
</div>
</div>
<div className="col col--4">
<div className={styles.featureBox}>
<h3>🛠️ Custom Detectors</h3>
<p>Create <a href="/tools/misti/docs/hacking/custom-detector">custom detectors</a> to solve specific problems in your code or to provide a thorough security review if you are an auditor.</p>
<p>
Create{' '}
<a href="/tools/misti/docs/hacking/custom-detector">
custom detectors
</a>{' '}
to solve specific problems in your code or to provide a
thorough security review if you are an auditor.
</p>
</div>
</div>
</div>

</div>
</section>

<section className={`${styles.features} ${styles.sectionPadding} ${styles.alternateBackground}`}>
<div className="container">
<h2 className={styles.featuresTitle}>Discover Detectors</h2>
<p className={styles.featuresSummary}>
Misti supports 25 specialized detectors designed to identify code issues, detect vulnerabilities, and enforce best practices.
</p>

<div className={`${styles.rowWithMargin} row`}>
{/* TON & Tact Specific */}
<div className="col col--4">
<div className={styles.featureBox}>
<h3>🌐 TON & Tact Specific</h3>
<p>Detect patterns unique to TON and Tact that could lead to unintended behavior, such as <a href="/tools/misti/docs/detectors/CellOverflow">CellOverflow</a> or <a href="/tools/misti/docs/detectors/StringReceiversOverlap">StringReceiversOverlap</a>.</p>
</div>
</div>
{/* DoS Prevention */}
<div className="col col--4">
<div className={styles.featureBox}>
<h3>🚫 DoS Prevention</h3>
<p>Identify vulnerabilities that could lead to Denial of Service attacks, like <a href="/tools/misti/docs/detectors/SendInLoop">SendInLoop</a> or <a href="/tools/misti/docs/detectors/UnboundMap">UnboundMap</a>.</p>
</div>
</div>
{/* Arithmetic Accuracy */}
<div className="col col--4">
<div className={styles.featureBox}>
<h3>➗ Arithmetic Accuracy</h3>
<p>Avoid critical calculation errors with detectors like <a href="/tools/misti/docs/detectors/DivideBeforeMultiply">DivideBeforeMultiply</a>.</p>
</div>
</div>
</div>

<div className={`${styles.rowWithMargin} row`}>
{/* Access Control & Authorization */}
<div className="col col--4">
<div className={styles.featureBox}>
<h3>🔐 Access Control</h3>
<p>Ensure only authorized entities perform actions, preventing unauthorized access with detectors like <a href="/tools/misti/docs/detectors/SuspiciousMessageMode">SuspiciousMessageMode</a>.</p>
</div>
</div>
{/* Code Optimization */}
<div className="col col--4">
<div className={styles.featureBox}>
<h3>⚡ Code Optimization</h3>
<p>Enhance code efficiency and readability with detectors like <a href="/tools/misti/docs/detectors/OptimalMathFunction">OptimalMathFunction</a> and <a href="/tools/misti/docs/detectors/PreferAugmentedAssign">PreferAugmentedAssign</a>.</p>
</div>
</div>
{/* Suspicious Patterns */}
<div className="col col--4">
<div className={styles.featureBox}>
<h3>🕵️ Suspicious Patterns</h3>
<p>Uncover subtle issues in your code with detectors such as <a href="/tools/misti/docs/detectors/ZeroAddress">ZeroAddress</a> and <a href="/tools/misti/docs/detectors/InheritedStateMutation">InheritedStateMutation</a>.</p>
</div>
</div>
</div>

<div className={`${styles.buttons} ${styles.centerButton}`}>
<a
className="button button--primary button--lg"
href="/tools/misti/docs/detectors"
>
View All Detectors
</a>
</div>
</div>
</section>
{}
</main>
</Layout>
);
Expand Down

0 comments on commit c755672

Please sign in to comment.