Repository navigation
Conversation
Bounty odiseo159-beep#2. Un contrato atacante (test/AtacanteDeReentrada.sol) que, al recibir ETH, reentrar en settle y en refund — sobre el mismo bounty y sobre uno distinto — mientras es verifier y developer a la vez, para que ningún check de rol enmascare el resultado. Cada test comprueba el selector del revert: exige Reentrancy() y no NotOpen(), de modo que la prueba distingue 'la guardia aguantó' de 'un guardado accidental del orden de estado'. npx hardhat test: 48 passing. Mutante sin nonReentrant: los 4 tests de ataque fallan (dos por NotOpen al no haber guardia, dos porque el segundo bounty sí se drena), el resto verde.
Author
Decision: Tests Run
Raw runtime output was retained in local Gitmoot state and is not posted here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounty: #10
Ataca la guardia de reentrada de
settleyrefunden vez de fiarse de ella.Qué trae
contracts/test/AtacanteDeReentrada.sol— contrato atacante (entest/, como pide el bounty) que al recibir ETH reentra ensettley enrefund, sobre el mismo bounty y sobre uno distinto.contracts/test/MergitEscrow.test.js.Por qué el atacante es verifier y developer a la vez: sus callbacks cumplen todos los checks de rol, así que lo único que puede frenarlos es la guardia. Con la guardia fuera,
ReintentarOtroSettledrena un segundo bounty en la misma transacción — ese es el ataque real, no solo el reintento del mismo bounty.Cómo prueban algo de verdad: cada test comprueba el selector del revert y exige
Reentrancy()(0xab143c06), noNotOpen(). Sin guardia, los tests de mismo-bounty fallan conNotOpen(lo salva el cambio de estado, no la guardia) y los de bounty-distinto fallan drenando el segundo bounty. Mutante verificado: quitarnonReentrantdesettle/refund→ 4 failing, resto verde.npx hardhat testencontracts/: 48 passing.