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

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

chevron-rightTest case to reproduce the mismatchhashtag

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?