Skip to content
Business logic Audit finding Intermediate

Lack of deadline check in forwarded request

The Forwarder contract's signed requests lack a deadline, so a signed request remains valid indefinitely as long as its nonce is unused. An attacker could execute a signed request much later than intended, when market conditions or contract state have changed.

LeoGold Follow with 0x0107, 0xvd and 27 others

Originally disclosed on Code4rena

Submitted by LeoGold, also found by 0x0107, 0xvd, Abysser, air_0x, Bauchibred, Bryan_Conquer, d3e4, francoHacker, Hueber, hyuunn, Infect3d, Kaysoft, KodoSec, komane007, Lamsy, LhoussainePh, MSK, ok567, owanemi, oxchsyston, patitonar, phoenixV110, pindarev, santipu_, SBSecurity, Sherlock__VARM, tourist, unnamed, and vangrim

https://github.com/code-423n4/2025-01-next-generation/blob/499cfa50a56126c0c3c6caa30808d79f82d31e34/contracts/Forwarder.sol#L32-L38

https://github.com/code-423n4/2025-01-next-generation/blob/499cfa50a56126c0c3c6caa30808d79f82d31e34/contracts/Forwarder.sol#L93-L118

Finding description and impact

Without a deadline parameter, each ForwardRequest is potentially valid indefinitely. This means that once a request is signed, it can be executed at any point in the future, provided that the nonce has not yet been used. If a request remains valid forever without a deadline, allowing it to be executed much later than the signer might have intended. This can lead to situations where the execution context (e.g., market conditions, contract states) has drastically changed from when the request was originally signed. Signers have no mechanism to limit the time window during which their request is valid, reducing their control over their own transactions.

Proof of Concept

it('should forward transfer in long future time', async function () {
                 // Increase the time by 6 months (15552000 seconds)
                await ethers.provider.send("evm_increaseTime", [15552000]);
                var data = interface.encodeFunctionData('transfer', [alice.address, 50]);
                var result = await signForward(provider, eurftoken.target, forwarder.target, bob, 1000000000000, data);
                expect(
                    await forwarder.connect(forwardOperator).execute(
                        result.request,
                        result.domainSeparator,
                        result.TypeHash,
                        result.suffixData,
                        result.signature,
                    )
                ).to.emit(eurftoken, 'Transfer').withArgs(bob.address, alice.address, 50);
                expect(await eurftoken.balanceOf(bob.address)).to.equal(950);
                expect(await eurftoken.balanceOf(alice.address)).to.equal(1050);
            });

In Token.js add the above it block to the TRANSFER describe block in the FORWARDER describe and run the test.

LOGS:

FORWARDER
      TRANSFER
 ✔ should forward transfer in long future time

Recommended mitigation steps

Adjust the ForwardRequest struct to include a deadline parameter. Consider implementing logic within the contract’s execution function to check the current block timestamp against the request’s deadline; rejecting any requests that are past their expiration. You can check the standard that was followed in implementing the forwarder in openGSN codebase here.

0xsomeone (judge) commented:

The submission and its duplicates outline that signed payloads for the Forwarder lack an expiry and can thus remain dormant indefinitely.

Coupled with the fact that no mechanism exists to invalidate a nonce directly, I believe this to be a valid medium risk issue in the code. The system should either introduce a deadline parameter to signed payloads and/or permit nonces to be invalidated directly, ensuring that conflicting permits that would result in an on-chain race condition can be avoided.


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

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

The ForwardRequest struct and execution logic omit a deadline field, so there is no timestamp check to reject stale requests.

Impact

A signed request could be executed much later than the signer intended, when market conditions or contract states have changed, reducing the signer's control over their transactions.

What the attacker needed

A signed forward request; the nonce remains unused

The fix

The ForwardRequest struct should include a deadline parameter, and the execution function should reject requests whose deadline has passed.

How it was found

  1. Advance the blockchain time by six months in a test environment.
  2. Encode a token transfer call and sign a forward request for it.
  3. Execute the signed request through the forwarder.
  4. Observe that the transfer still succeeds despite the long delay.

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.

A forwarder lets someone sign a message off-chain and have another party submit it on-chain later. Because the signed message has no expiry date, it can be used at any time in the future, even months later, which may surprise the person who signed it.

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 LeoGold

View all

1 more disclosed report, best first.

More from Next Generation

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.