Reentrancy — the withdraw that calls back before the balance drops
Reentrancy lets a callee re-enter the caller before its state updates, the class that drained The DAO in 2016; the fix (checks-effects-interactions) is old, and the bug still ships.
Not yet scoped.
Why
The PoC reproduces a minimal reentrancy exploit on a local fork, then shows the one-line ordering change and a reentrancy guard closing it — the canonical first lesson in smart-contract security.
How it works
Not yet built.
Where it lands in Jayverse
Verex contracts: add a checks-effects-interactions review and a reentrancy-guard to every withdraw/claim path in the ctf-exchange fork. Add a Foundry invariant test that fails on any external call occurring before its own balance write.
Bridge/DeFi: audit the lock-and-mint unlock path and the from-scratch staking withdraw path the same way. Both are the same "callback before state update" shape as the classic exploit, so the same guard and test belong there too.
Key expressions
Words and phrases from this page worth keeping, with the Korean meaning and the sentence they come from.
Expression
뜻 · 쓰이는 자리
re-enter
되돌아 들어오다(재진입하다) · 콜백이 상태 갱신 전에 다시 함수를 호출할 때. "lets a callee re-enter the caller"
drain
(자금을) 다 빼가다/탈탈 털다 · 해킹으로 컨트랙트 자금이 전부 빠져나갈 때. "drained The DAO in 2016"
still ships
여전히 (제품·코드로) 출시되다 · 오래된 버그가 지금도 실제 배포에 남아있을 때. "the bug still ships"
closing it
(취약점을) 막다/닫다 · 보안 결함을 최종적으로 해결할 때. "and a reentrancy guard closing it"
the canonical first lesson
가장 대표적인/기본이 되는 첫 교훈 · 해당 분야 입문에서 반드시 배우는 첫 사례. "the canonical first lesson in smart-contract security"
재진입은 호출된 쪽이 호출자의 상태 갱신 전에 다시 진입하게 하며, 2016년 The DAO를 털어낸 계급입니다. 해법(검사-효과-상호작용)은 오래됐지만 이 버그는 여전히 배포됩니다.
아직 범위 미정.
왜
이 PoC는 로컬 포크에서 최소 재진입 익스플로잇을 재현한 뒤, 한 줄 순서 변경과 재진입 가드가 그것을 막는 것을 보입니다 — 스마트 컨트랙트 보안의 정전급 첫 수업입니다.
동작 방식
아직 만들지 않음.
Jayverse에서의 위치
Verex 컨트랙트: ctf-exchange 포크의 모든 withdraw/claim 경로에 checks-effects-interactions 리뷰와 리엔트런시 가드를 추가한다. 자기 잔액 쓰기보다 먼저 일어나는 외부 호출이 있으면 실패하는 Foundry 인바리언트 테스트를 추가한다.
Bridge/DeFi: 락앤민트의 언락 경로와 처음부터 만든 스테이킹의 인출 경로도 같은 방식으로 감사한다. 둘 다 고전적 익스플로잇과 같은 "상태 갱신 전 콜백" 형태이므로 같은 가드와 테스트가 거기에도 필요하다.
핵심 표현
이 페이지의 영어 본문에서 배울 만한 단어와 표현, 뜻과 나온 자리.
Expression
뜻 · 쓰이는 자리
re-enter
되돌아 들어오다(재진입하다) · 콜백이 상태 갱신 전에 다시 함수를 호출할 때. "lets a callee re-enter the caller"
drain
(자금을) 다 빼가다/탈탈 털다 · 해킹으로 컨트랙트 자금이 전부 빠져나갈 때. "drained The DAO in 2016"
still ships
여전히 (제품·코드로) 출시되다 · 오래된 버그가 지금도 실제 배포에 남아있을 때. "the bug still ships"
closing it
(취약점을) 막다/닫다 · 보안 결함을 최종적으로 해결할 때. "and a reentrancy guard closing it"
the canonical first lesson
가장 대표적인/기본이 되는 첫 교훈 · 해당 분야 입문에서 반드시 배우는 첫 사례. "the canonical first lesson in smart-contract security"