LES (Light Ethereum Subprotocol) doesn't forward the transaction to the sequencer
The Light Ethereum Subprotocol (LES) backend in op-geth does not forward transactions to the sequencer when they are received over RPC, unlike the standard Ethereum API backend. An attacker could submit a transaction via LES and it would be added to the local pool but never sent to the sequencer, so it would never be processed or submitted to L1, misleading the user into thinking it succeeded.
Source: https://github.com/sherlock-audit/2023-01-optimism-judging/issues/175
Found by
Koolex
Summary
LES (Light Ethereum Subprotocol) doesn't forward the transaction to the sequencer when receiving it over RPC.
Vulnerability Detail
When a user submits a transaction to op-geth node (validator/verfier mode), the node sends the transaction to the sequencer, if no error, it adds it to the tx pool.
func (b *EthAPIBackend) SendTx(ctx context.Context, tx *types.Transaction) error {
if b.eth.seqRPCService != nil {
data, err := tx.MarshalBinary()
if err != nil {
return err
}
if err := b.eth.seqRPCService.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(data)); err != nil {
return err
}
}
return b.eth.txPool.AddLocal(tx)
}
https://github.com/ethereum-optimism/op-geth/blob/optimism-history/eth/api_backend.go#L253-L264
However, when LES, It only adds the transaction to the tx pool.
func (b *LesApiBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
return b.eth.txPool.Add(ctx, signedTx)
}
https://github.com/ethereum-optimism/op-geth/blob/optimism-history/les/api_backend.go#L193-L195
Note: Sequencer http flag is configured only if we're running in verifier mode.
Impact
- Transction isn't sent to the sequencer and will never be processed (submitted to L1).
- Inconsistency among op-geth nodes validators/verifiers and the sequencer.
- Additionally, from UX perspective, it is misleading as the user would think the transaction was submitted "successfully".
Code Snippet
Check above.
Tool used
Manual Review
Recommendation
Match this RPC change in the LES RPC. As it seems to be overlooked.
Ref: https://op-geth.optimism.io/
Discussion
rcstanciu
Comment from Optimism
Description: LES doesn't forward transactions to the sequencer
Reason: We don't support LES, so this is out-of-scope.
Action: No action.
koolexcrypto
Escalate for 53 USDC
I kindly ask you to reconsider the assessment due to the following reasons:
-
In the contest description, it lists the components that are in scope:
The key components of the system can be found in our monorepo at commit 3f4b3c3281. L1 Contracts L2 Contracts (AKA Predeploys) op-node op-geth (in its own repo)
op-geth is listed as it is, and it is never mentioned anywhere in the docs that LES is out of scope. As a participant, I spent quite some time to look for bugs in LES. otherwise, I would have shifted my focus on some other parts of the component considering the short time of the contest. On a personal level, it feels a bit unfair.
-
If you go over LES directory in the source code. You could see the code was adapted to match Optimism specs. This actually gave me a confirmation that it is in scope. Here are some examples:
- L1CostFunc was added
- RollupSequencerHTTP and RollupHistoricalRPC
- Adapting stateAtTransaction func to consider L1CostFunc
sherlock-admin
Escalate for 53 USDC
I kindly ask you to reconsider the assessment due to the following reasons:
- In the contest description, it lists the components that are in scope:
The key components of the system can be found in our monorepo at commit 3f4b3c3281. L1 Contracts L2 Contracts (AKA Predeploys) op-node op-geth (in its own repo)
op-geth is listed as it is, and it is never mentioned anywhere in the docs that LES is out of scope. As a participant, I spent quite some time to look for bugs in LES. otherwise, I would have shifted my focus on some other parts of the component considering the short time of the contest. On a personal level, it feels a bit unfair.
- If you go over LES directory in the source code. You could see the code was adapted to match Optimism specs. This actually gave me a confirmation that it is in scope. Here are some examples:
- L1CostFunc was added
- RollupSequencerHTTP and RollupHistoricalRPC
- Adapting stateAtTransaction func to consider L1CostFunc
You've created a valid escalation for 53 USDC!
To remove the escalation from consideration: Delete your comment. To change the amount you've staked on this escalation: Edit your comment (do not create a new comment).
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
Evert0x
Escalation accepted.
Labeling as medium severity.
This was an oversight on Optimism's part and there are markers that would suggest it should be in scope.
sherlock-admin
Escalation accepted.
Labeling as medium severity.
This was an oversight on Optimism's part and there are markers that would suggest it should be in scope.
This issue's escalations have been accepted!
Contestants' payouts and scores will be updated according to the changes made on this issue.
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 LES API backend's SendTx method was not updated to match the standard backend's logic of forwarding transactions to the sequencer before adding them to the pool.
Impact
Transactions submitted via LES are never sent to the sequencer and will never be processed, causing inconsistency among nodes and misleading users into thinking their transaction succeeded.
What the attacker needed
Op-geth node running in LES mode; user submits transaction via LES RPC
The fix
The LES RPC should be updated to match the standard RPC change and forward transactions to the sequencer.
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.
In Ethereum-like systems, a sequencer orders transactions. Normally, when you send a transaction to a node, the node forwards it to the sequencer. The light client mode (LES) skips this forwarding step, so your transaction gets stuck locally and never reaches the sequencer. This means it never gets processed, but you might think it did.
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.