Summary
100% of all REPORTED Findings have been addressed
- 0Acknowledged
- 0Risk Accepted
- 12Solved
- 12All Findings
- Critical0
- High3
- 3Solved
- Medium1
- 1Solved
- Low2
- 2Solved
- Informational6
- 6Solved
Introduction#
Halborn was engaged by the Normal AMM team to perform a targeted security assessment of their Soroban-based automated market maker (AMM) protocol on Stellar. The scope included analyzing the core on-chain components responsible for liquidity management, routing, oracle integration, incentives, and access control. The assessment aimed to verify correctness, safety, and economic robustness.
Assessment Summary#
A senior blockchain security engineer from Halborn conducted the review full-time. The engineer has extensive experience in Rust, Soroban/Stellar, AMM design, and protocol security, including upgradeability, authorization, and oracle systems.
The codebase components reviewed included:
Contracts:
pool,pool_router,oracle_registry,pool_plane,pool_swap_fee,insurance_fund,liquidity_calculator,tokenShared modules:
access_control,incentives,utils,upgrade
The review focused on verifying economic invariants (such as pricing, fees, and shares), oracle validation and safeguards, privilege boundaries, emergency controls, and upgrade procedures.
Engagement objectives included:
Ensuring that new and modified functions behave as intended and are resistant to misuse and edge cases.
Identifying vulnerabilities that could lead to fund loss, invariant violations, incorrect state transitions, oracle manipulation, privilege escalation, or denial of service.
Highlighting areas where stronger invariants, defensive checks, or clearer authorization controls can reduce operational and economic risks.
Test Approach and Methodology#
To ensure comprehensive and cross-cutting coverage, the assessment employed a consistent methodology across all first-party contracts and shared modules within the workspace:
Contracts:
buffer,insurance_fund,liquidity_calculator,oracle_registry,pool,pool_plane,pool_router,pool_swap_fee,tokenShared modules:
access_control,incentives,pool_tokens,upgrade,utilsIntegration tests located in:
contracts/integration_tests
The approach combined architecture mapping, manual expert review, static and dynamic analysis, property-based testing, and adversarial scenario simulations:
1) Repository-wide inventory and architecture mapping
Mapped all public entry points declared in
interface.rsand within#[contractimpl]blocks; analyzed data and control flows amongpool,pool_router,oracle_registry,pool_plane,liquidity_calculator,insurance_fund, and token contracts.Identified trust boundaries, administrative roles, kill switches, upgrade paths, and oracle dependencies; documented invariants for each component.
2) Manual line-by-line review (across all crates)
Examined each contract’s
contract.rs,storage.rs,errors.rs, andevents.rsfiles:Verified authorization and role checks via
modules/access_control.Assessed storage keys, data lifetimes, bumping strategies, and differentiated between persistent and temporary data usage.
Analyzed mathematical invariants within
pool.rs,liquidity_calculator,pool_swap_fee,utils::math, andincentivesmechanisms.Reviewed cross-contract calls (router, oracle, plane, token) for error propagation, potential DoS vulnerabilities, and reentrancy issues.
Verified upgrade flows via
modules/upgradeacross upgradable contracts.Assessed emergency/kill toggles, expiry, and settlement transition mechanisms.
Ensured event schemas are consistent and correctly implemented.
3) Static analysis and linting (workspace-wide)
Applied linting tools and targeted grep scans to identify anti-patterns, including:
Unchecked type conversions, saturation underflows, panics affecting user flows.
Misuse of
U256and fixed-point math, including rounding errors.Incomplete authorization checks and role management inconsistencies.
4) Property-based testing and fuzzing for critical math routines
Focused on:
Swap route correctness, fee adjustments, and invariant violations (such as fee residues).
Precision in receive computations and boundary condition handling.
Price functions (
peg_price,get_delta_a) and rolling metrics.Incentives accumulation and distribution, including per-user and per-pool calculations, with correct handling of pagination constants.
Tested edge cases involving zero or near-zero values, maximum fees, large reserves, and rounding boundaries.
5) Stateful adversarial testing and PoC development
Designed multi-step scenarios across contracts to detect emergent behaviors:
Upgrade commit, apply, and revert; emergency mode activation and deactivation within deadlines.
Kill/un-kill toggles; roles for pausing versus emergency pauses.
Handling of oracle data volatility and staleness, cached versus fresh data paths, with safeguards.
Insurance fund claims constrained by tiers and thresholds.
Router orchestration and liquidity calculator during failures.
Prototype calculations for NAV/share underpricing during rebalancing, supported by mathematical proof independent from harness dependencies.
6) Integration testing and cross-contract orchestration
Utilized existing integration tests and created custom scenarios:
Deployment of contracts using
contractimport!forpool_plane,liquidity_calculator,pool_router, andoracle_registry.End-to-end testing covering initialization, deposits, swaps, withdrawals, incentives, claims, rebalancing, upgrades, and emergency procedures.
Used functions like
utils::test_utils::jumpto manipulate time for testing staleness, delays, and expiry conditions.
7) Permission boundary testing (positive and negative cases)
Systematically verified role-based permissions for
Admin,EmergencyAdmin,RewardsAdmin,OperationsAdmin,PauseAdmin, andEmergencyPauseAdmin. Patterns followed those in each crate’stest_permissions.rs.Reviewed ownership transfer workflows and deadline enforcement for correctness.
8) Oracle validation and economic safety assessment
Validated oracle safeguards, including volatility thresholds, staleness limits, clamping, TWAP updates, and cached versus live data handling.
Assessed core economic invariants such as:
Enforcement of AMM invariant, accurate fee accounting, and residue handling.
Share valuation consistency aligned with pool NAV during rebalancing.
Limits on insurance coverage per tier, as well as revenue withdrawals and settlement procedures.
9) Token interactions and assumptions testing
Verified token helper functions (
utils::token), pool token management (pool_tokens), and behaviors regarding allowances and transfers.Analyzed dependencies on standard token implementations and error handling pathways for non-standard tokens in strict-receive and refund scenarios.
10) Performance, resource consumption, and reliability evaluations
Considered ledger instruction limits, storage growth, and pagination (e.g.,
PAGE_SIZE).Examined
pool_planeupdates for potential liveness issues and recommended implementing soft-fail patterns where appropriate to improve reliability.
11) Test execution and validation strategy
Developed targeted tests and proofs of concept to validate identified risks and invariants, including snapshot captures of critical error pathways.
This methodology achieved full coverage of the codebase with focused depth on high-risk areas such as oracle integration, upgradeability, access control, AMM mathematics, and incentives, enabling the detection of both correctness and economic vulnerabilities.
Risk Methodology#
4.1 EXPLOITABILITY
Attack Origin (AO):
Attack Cost (AC):
Attack Complexity (AX):
Metrics:
| EXPLOITABILITY METRIC () | METRIC VALUE | NUMERICAL VALUE |
|---|---|---|
| Attack Origin (AO) | Arbitrary (AO:A) | 1 |
| Specific (AO:S) | 0.2 | |
| Attack Cost (AC) | Low (AC:L) | 1 |
| Medium (AC:M) | 0.67 | |
| High (AC:H) | 0.33 | |
| Attack Complexity (AX) | Low (AX:L) | 1 |
| Medium (AX:M) | 0.67 | |
| High (AX:H) | 0.33 |
4.2 IMPACT
Confidentiality (C):
Integrity (I):
Availability (A):
Deposit (D):
Yield (Y):
Metrics:
| IMPACT METRIC () | METRIC VALUE | NUMERICAL VALUE |
|---|---|---|
| Confidentiality (C) | None (C:N) | 0 |
| Low (C:L) | 0.25 | |
| Medium (C:M) | 0.5 | |
| High (C:H) | 0.75 | |
| Critical (C:C) | 1 | |
| Integrity (I) | None (I:N) | 0 |
| Low (I:L) | 0.25 | |
| Medium (I:M) | 0.5 | |
| High (I:H) | 0.75 | |
| Critical (I:C) | 1 | |
| Availability (A) | None (A:N) | 0 |
| Low (A:L) | 0.25 | |
| Medium (A:M) | 0.5 | |
| High (A:H) | 0.75 | |
| Critical (A:C) | 1 | |
| Deposit (D) | None (D:N) | 0 |
| Low (D:L) | 0.25 | |
| Medium (D:M) | 0.5 | |
| High (D:H) | 0.75 | |
| Critical (D:C) | 1 | |
| Yield (Y) | None (Y:N) | 0 |
| Low (Y:L) | 0.25 | |
| Medium (Y:M) | 0.5 | |
| High (Y:H) | 0.75 | |
| Critical (Y:C) | 1 |
4.3 SEVERITY COEFFICIENT
Reversibility (R):
Scope (S):
Metrics:
| SEVERITY COEFFICIENT () | COEFFICIENT VALUE | NUMERICAL VALUE |
|---|---|---|
| Reversibility () | None (R:N) | 1 |
| Partial (R:P) | 0.5 | |
| Full (R:F) | 0.25 | |
| Scope () | Changed (S:C) | 1.25 |
| Unchanged (S:U) | 1 |
| Critical | High | Medium | Low | Informational |
| 9 - 10 | 7 - 8.9 | 4.5 - 6.9 | 2 - 4.4 | 0 - 1.9 |
Scope#
Assessment Summary & Findings Overview#
# | Title | Severity | Score | Status |
|---|---|---|---|---|
| Oracle Registry Argument Swap Triggers Panic on Price Up-Ticks | High | 7.5 | Solved08/01/2025 | |
| Sanitize New Price Underflows On Price Drop, Triggering Protocol Wide Panic | High | 7.5 | Solved08/01/2025 | |
| NAV Underpricing via Fixed Share Minting | High | 7.5 | Solved08/04/2025 | |
| PoolRouter Reward Front-Run Enables Zero-Emission Griefing | Medium | 5.0 | Solved08/01/2025 | |
| Dust-Initialisation / Fee-Skimming Risk — totalLP Can Fall to 0 | Low | 2.5 | Solved07/29/2025 | |
| Stale-delay Allows Frozen or Cached Prices to Look Fresh | Low | 2.5 | Solved08/01/2025 | |
| Zero-Amount Deposits Allowed | Informational | 1.7 | Solved07/30/2025 | |
| Zero-Amount Stake Accepted | Informational | 1.7 | Solved07/30/2025 | |
| Price-override Cooldown can be Bypassed | Informational | 1.1 | Solved08/01/2025 | |
| Redundant Ownership-Transfer: Future Owner Can Equal Current Owner | Informational | 0.5 | Solved08/01/2025 | |
| sanitize_clamp_denominator is Unchecked (Division-by-Zero Risk) | Informational | 0.4 | Solved07/31/2025 | |
| Unbounded Synthetic-Minting During “Reduce-Only” Mode | Informational | 0.0 | Solved08/01/2025 |
Findings & Tech Details#
Description
Proof of Concept
Recommendation
Remediation Comment
Description
Proof of Concept
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
References
- Uniswap V2 Whitepaper, section 3.4 “Minimum Liquidity”
- Uniswap V2 Core implementation — MINIMUM_LIQUIDITY = 1000 burned to address(0)
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Disclaimer#
Halborn strongly recommends conducting a follow-up assessment of the project either within six months or immediately following any material changes to the codebase, whichever comes first. This approach is crucial for maintaining the project’s integrity and addressing potential vulnerabilities introduced by code modifications.
