Skip to content

Latest commit

 

History

History
32 lines (29 loc) · 659 Bytes

File metadata and controls

32 lines (29 loc) · 659 Bytes

EthTaipei CTF 2023 - Hello World

  • Scope
    • HelloWorld.sol
  • Tools

Findings

Vulnerability Details

The answer is explicitly provided in the constructor.

constructor() {
-        _answer = keccak256(abi.encodePacked("HelloWorld"));
    }

Impact/Proof of Concept

function testCorrectAnswer() public {
        HelloWorld h = base.helloWorld();
        h.answer("HelloWorld");
        console.log("success: ",h.success());
        base.solve();
        assertTrue(base.isSolved());
    }

Results

[PASS] testCorrectAnswer() (gas: 61543)
Logs:
  success:  true