Skip to content

L-04 add missing reentrancy guard in FlashtestationRegistry:invalidat…#28

Merged
Melvillian merged 2 commits intomainfrom
L-04/missing-reentrancy-guard-in-invalidateAttestation
Aug 18, 2025
Merged

L-04 add missing reentrancy guard in FlashtestationRegistry:invalidat…#28
Melvillian merged 2 commits intomainfrom
L-04/missing-reentrancy-guard-in-invalidateAttestation

Conversation

@Melvillian
Copy link
Collaborator

…eAttestation

This addresses the L-04 item of the Q3 2025 OZ audit

Functions that register new TEE services have a reentrancy guard modifier because they do not follow the CEI pattern and rely on the external call verifyAndAttestOnChain from the attestation contract. While this call can be trusted because the attestation contract should not be malicious and is not upgradeable, there are situations where the execution is forwarded to the tx.origin.

Hence, with the recent introduction of EIP-7702, it is possible for a malicious user to reenter the FlashtestationRegistry with an outdated state. For this reason, the reentrancy guard is completely necessary. However, while the invalidateAttestation function relies on this external call, it does not have the reentrancy guard protection. Hence, it is vulnerable to being reentered.

Consider adding the nonReentrant modifier to the invalidateAttestation function.

…eAttestation

This addresses the L-04 item of the Q3 2025 OZ audit

Functions that register new TEE services have a reentrancy guard modifier because they do
not follow the CEI pattern and rely on the external call verifyAndAttestOnChain from the
attestation contract. While this call can be trusted because the attestation contract should not
be malicious and is not upgradeable, there are situations where the execution is forwarded to
the tx.origin.

Hence, with the recent introduction of EIP-7702, it is possible for a malicious user to reenter
the FlashtestationRegistry with an outdated state. For this reason, the reentrancy
guard is completely necessary. However, while the invalidateAttestation function relies
on this external call, it does not have the reentrancy guard protection. Hence, it is vulnerable to being reentered.

Consider adding the nonReentrant modifier to the invalidateAttestation function.
@Melvillian Melvillian force-pushed the L-04/missing-reentrancy-guard-in-invalidateAttestation branch from 4f71253 to c719a4e Compare August 18, 2025 20:04
@Melvillian Melvillian merged commit cbcd939 into main Aug 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant