Security and Vulnerabilities Flashcards
7 cards from real Blockchain Technology practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Security and Vulnerabilities flashcards as text
What is the purpose of a reentrancy guard (nonReentrant modifier)?
Answer: It locks the function during execution to prevent nested calls
A mutex-style lock set at entry and cleared at exit blocks recursive re-entry into the protected function.
Why should the return value of a low-level .call be checked?
Answer: It does not revert on failure; the success boolean must be verified
Low-level call returns a success boolean instead of reverting, so unchecked failures can be silently ignored.
What is a signature replay attack?
Answer: Reusing a valid signature in a context where it should only be used once
Without a nonce or domain separator, a valid signature can be replayed on the same or another contract/chain.
Which EIP standard defines structured, domain-separated data hashing to prevent cross-contract signature replay?
Answer: EIP-712
EIP-712 specifies typed structured data signing with a domain separator that binds signatures to a specific contract and chain.
What is the danger of leaving 'private' data in contract storage?
Answer: Private only restricts Solidity access, not on-chain readability
The private keyword only blocks other contracts/inheritance from reading it in code; all storage is publicly readable on-chain.
A withdraw function uses transfer() to send Ether. Why might this break for smart-contract recipients after gas repricing?
Answer: transfer forwards only 2300 gas, which may be insufficient for the recipient
The fixed 2300 gas stipend of transfer can fail when receiving contracts need more gas, so call with checks is now preferred.
What does a 'griefing' attack typically aim to achieve?
Answer: Disrupt or block normal operation without direct financial gain
Griefing seeks to deny service or waste resources for others, even when the attacker gains nothing financially.