Skip to content
Business logic Audit finding Beginner

Missing validation in setparameters allows invalid fee configuration causing reverts in paytovenue

The setParameters function allows the owner to set a processing fee percentage higher than the platform subsidy percentage without validation. This causes an underflow in payToVenue when paying with LONG tokens, reverting all such payments and breaking a core payment pathway.

DoD4uFN Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

57913 sc insight missing validation in setparameters allows invalid fee configuration causing reverts in paytovenue

Submitted on Oct 29th 2025 at 12:43:55 UTC by @DoD4uFN for Audit Comp | Belong

Description

Brief/Intro

The setParameters function in BelongCheckIn.sol allows the contract owner to configure fee parameters without any validation. This includes _fees.platformSubsidyPercentage and _fees.processingFeePercentage, which are later assumed to maintain a specific relationship. If misconfigured such that processingFeePercentage > platformSubsidyPercentage, any call to payToVenue using LONG tokens will revert, causing a denial of service for LONG-based payments.

Vulnerability Details

The payment flow in payToVenue depends on the assumption that the platform subsidy percentage is greater than or equal to the processing fee percentage. This invariant is not enforced anywhere, including the owner-only configuration function setParameters.

When a customer pays using LONG tokens, the code calculates:

Solidity
uint256 subsidyMinusFees =
    _storage.fees.platformSubsidyPercentage.calculateRate(customerInfo.amount)
    - _storage.fees.processingFeePercentage.calculateRate(customerInfo.amount);

If _fees.processingFeePercentage > _fees.platformSubsidyPercentage, the subtraction will underflow (or revert depending on compiler/version), causing payToVenue to revert. This disables all LONG-token payments.

There is no validation ensuring:

platformSubsidyPercentage >= processingFeePercentage

leaving the system vulnerable to misconfiguration.

Impact Details

If processingFeePercentage is set higher than platformSubsidyPercentage, every call to payToVenue with LONG tokens will revert. No direct fund loss is described, but the vulnerability fully breaks a core payment pathway.

References

Proof of Concept

{% stepper %} {% step %}

Step 1 — Owner sets invalid fees

Owner calls setParameters with an invalid configuration:

Solidity
Fees memory invalidFees = Fees({
    referralCreditsAmount: 3,
    affiliatePercentage: 1000,
    longCustomerDiscountPercentage: 3000,
    platformSubsidyPercentage: 300,
    processingFeePercentage: 301, // invalid: greater than platformSubsidyPercentage
    buybackBurnPercentage: 5000
});

{% endstep %}

{% step %}

Step 2 — Customer attempts LONG token payment

A customer calls payToVenue() with any valid CustomerInfo indicating a LONG token payment. {% endstep %}

{% step %}

Step 3 — Transaction reverts

The transaction reverts due to the subtraction:

Solidity
uint256 subsidyMinusFees = 
    _storage.fees.platformSubsidyPercentage.calculateRate(customerInfo.amount) -
    _storage.fees.processingFeePercentage.calculateRate(customerInfo.amount);

Because processingFeePercentage > platformSubsidyPercentage, this results in an underflow/revert and breaks the payment flow. {% endstep %} {% endstepper %}

The original report as published on Immunefi, by DoD4uFN. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the setParameters function lacks a check that platformSubsidyPercentage is greater than or equal to processingFeePercentage, so an invalid configuration can be set.

Impact

Every call to payToVenue with LONG tokens will revert, fully breaking that payment pathway, though no direct fund loss is described.

What the attacker needed

Owner sets invalid fee configuration

How it was found

  1. Owner calls setParameters with processingFeePercentage greater than platformSubsidyPercentage.
  2. Customer calls payToVenue with a LONG token payment.
  3. The transaction reverts due to underflow in the subtraction.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

The contract owner can set two fee numbers: a subsidy and a processing fee. The code later subtracts the processing fee from the subsidy, assuming the subsidy is always bigger. If the owner accidentally sets the processing fee higher, the subtraction goes negative and the payment fails, so nobody can pay with that token.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by DoD4uFN

View all

6 more disclosed reports, best first.

More from Belong

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.