F-2024-0010·redundant-validation

Wrong validation checks

Fixedaccount-abstractionerc-4337subscriptiongithub.com/bastion-wallet
TL;DR

Duplicate and missing validation checks across initiatePayment and registerSubscription: validity timestamps are checked twice, amount zero-check is duplicated across contracts, and there is no enforcement that validUntil > validAfter.

Severity
LOW
Impact
LOW
Likelihood
LOW
Method
MManual review
CAT.
Complexity
LOW
Exploitability
LOW
02Section · Description

Description

  • The processPayment() performs validation checks for validAfter and validUntil properties but these checks are already performed in the initiatePayment() function that executes processPayment().

  • When registering a subscription _validUntil should be enforced to be larger than _validAfter which is set to block.timestamp, to ensure that the newly created subscription is valid.

  • When registering a subscription in the createSubscription() function in the SubExecutor.sol contract there is a zero-address check for the amount but this check is already performed in the registerSubscription() function in Initiator.sol contract which is executed internally.

solidity
/// @notice Initiates a payment for a given subscriber
/// @param _subscriber Address of the subscriber
/// @dev This function ensures that the subscription is active and the
/// payment interval has been reached
function initiatePayment(address _subscriber) public nonReentrant {
require(subscription.validUntil > block.timestamp, "Subscription is not active");
require(subscription.validAfter < block.timestamp, "Subscription is not active");
}
03Section · Impact

Impact

Redundant gas usage on every payment call, and a missing invariant check that allows nonsensical subscriptions with validUntil <= validAfter to be registered.

04Section · Recommendation

Recommendation

  • Consider removing the duplicated validation checks:

    diff
    function initiatePayment(address _subscriber) public nonReentrant {
    - require(subscription.validUntil > block.timestamp, "Subscription is not active");
    - require(subscription.validAfter < block.timestamp, "Subscription is not active");
    }
    - require(_amount > 0, "Subscription amount is 0");
  • Add the following validation check in the registerSubscription() function, and consider setting a minimum subscription's validity period as well:

    diff
    + require(_validUntil > _validAfter, "Wrong subscription's timestamp validity");
05Section · Resolution

Resolution

Team Response: Acknowledged and fixed as suggested.

Status
Fixed
Fix commit
79cddfeb6070
F-2024-0010

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx