Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Negative test for a reentrant attack on the core relayer forward mechanism #83

Merged

Conversation

scnale
Copy link
Collaborator

@scnale scnale commented Feb 7, 2023

Depends on #82. I thought that the modification to the genericRelayer() function that simulates the relaying there was enough, but I still needed a way to conditionally invoke the mechanism without it failing and had to do further adjustments. In this way, the relayer can be simulated if the attack is successful, ensuring the test fails in that case.

To test that the test does fail when the attack is successful you can comment these and this lines.

Copy link
Contributor

@derpy-duck derpy-duck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me; thanks for improving the generic relayer in the forge tests!

@derpy-duck derpy-duck merged commit aff9e90 into tests/improve-relay-mock Feb 10, 2023
@scnale
Copy link
Collaborator Author

scnale commented Feb 10, 2023

Ah, I fear github didn't update the target branch for this pull request adequately 😅. I'll merge that branch into #81.

scnale added a commit that referenced this pull request Feb 10, 2023
…anism (#83)

* Modifies the relayer simulation to be easier to use in negative tests.

* Adds negative test for a reentrancy attack on the forward mechanism.

* `forge fmt` run.
@scnale scnale deleted the tests/attack-core-relayer-forward branch February 10, 2023 23:57
derpy-duck pushed a commit that referenced this pull request Feb 14, 2023
…anism (#83)

* Modifies the relayer simulation to be easier to use in negative tests.

* Adds negative test for a reentrancy attack on the forward mechanism.

* `forge fmt` run.
scnale added a commit that referenced this pull request Feb 14, 2023
…anism (#83)

* Modifies the relayer simulation to be easier to use in negative tests.

* Adds negative test for a reentrancy attack on the forward mechanism.

* `forge fmt` run.
chase-45 pushed a commit that referenced this pull request Feb 14, 2023
…anism (#83)

* Modifies the relayer simulation to be easier to use in negative tests.

* Adds negative test for a reentrancy attack on the forward mechanism.

* `forge fmt` run.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants