57013 sc insight incorrect event parameter in inboundtransferratelimited emits recipient instead of caller

  • Report ID: #57013

  • Report Type: Smart Contract

  • Report severity: Insight

  • Target: https://github.com/Folks-Finance/algorand-ntt-contracts/blob/main/ntt_contracts/ntt_manager/NttRateLimiter.py

  • Submitted on Oct 22nd 2025 at 16:01:49 UTC by @yashar for Audit Comp | Folks Finance: Wormhole NTT on Algorand

Description

Brief / Intro

The NttRateLimiter contract emits an InboundTransferRateLimited event when an inbound transfer is enqueued due to insufficient capacity. However, the event field labeled sender is incorrectly populated with the recipient’s address, not the caller or actual sender.

Vulnerability Details

In _enqueue_or_consume_inbound_transfer, the event is emitted as:

NttRateLimiter.py (snippet)
            emit(InboundTransferRateLimited(
                recipient,
                message_digest,
                current_capacity,
                ARC4UInt64(untrimmed_amount))
            )
            return Bool(True)

while the struct defines:

This results in a semantic mismatch: the event’s sender field actually contains the recipient address. Indexers, monitoring tools, and analytics relying on event schemas will misinterpret who triggered the action.

Impact Details

Potential confusion or incorrect accounting in monitoring and analytics pipelines.

Proof of Concept

Test case to reproduce the mismatch

Add the following test case to NttRateLimiter.test.ts inside the enqueue or consume outbound transfer describe:

Run the test:

Expected/observed result when running the test:

References

(none provided)

Was this helpful?