Tyojong
[Solodit] Users with Level 5 Account May Bypass the Applied 12% Commissions 본문
[Solodit] Users with Level 5 Account May Bypass the Applied 12% Commissions
Tyojong 2025. 9. 19. 19:59개요
심각도 : High
언어 : Solidity
프로토콜 : Terplayer BVT Staking & Distribution
취약점 유형 : Logic Bug
이 리포트는 Terplayer BVT Staking & Distribution 프로토콜에서 Level 5 계정을 가진 사용자가 시스템의 12% 커미션을 우회할 수 있는 취약점에 대해 설명한다.
Level 5 계정은 일반적으로 recipientComission 주소로 12%의 커미션을 내야한다.
악의적인 사용자는 새 계정을 만든 뒤, 부모 계정을 자신의 Level 5 계정으로 지정한다.
새 계정에서 자산을 입금하면 이 과정에서 12% 커미션이 본인 Level 5 계정으로 지급된다.
결국 실질적으로 본인은 2% 커미션만 내고, 12%에 해당하는 자산을 추가로 획득하여 프로토콜을 손해 보게 만든다.
때문에 정상적인 12% 커미션 수익이 공격자에게 흘러가며, 프로토콜 손실이 발생한다.
영향 받는 코드
src/BvtRewardVault.sol 파일의 96번째 줄을 확인해보면
function deposit(uint256 amount) external nonReentrant {
// code
for (uint256 i = 0; i < commissionParents.length; i++) {
UserInfo memory parentInfo = commissionParents[i];
if (parentInfo.user == address(0)) {
continue;
}
uint256 commission = bondDealerContract.getCommission(
uint256(parentInfo.level)
);
uint256 commissionAmount = (amount *
(commission - totalHigherLevelCommissionAmountRate)) / 10000;
if (commissionAmount > 0) {
if (!isUserInDelegatedStakeList[msg.sender][parentInfo.user]) {
isUserInDelegatedStakeList[msg.sender][
parentInfo.user
] = true;
delegatedStakeUsers[msg.sender].push(parentInfo.user);
}
_delegateStake(msg.sender, parentInfo.user, commissionAmount);
userAmount -= commissionAmount;
totalHigherLevelCommissionAmountRate = commission;
}
}
if (recipientComission != address(0)) {
uint256 totalCommissionAmountRate = bondDealerContract
.getTotalCommission();
if (
totalCommissionAmountRate > totalHigherLevelCommissionAmountRate
) {
uint256 recipientCommissionAmount = (amount *
(totalCommissionAmountRate -
totalHigherLevelCommissionAmountRate)) /
MAX_COMMISSION_RATE;
if (
!isUserInDelegatedStakeList[msg.sender][recipientComission]
) {
isUserInDelegatedStakeList[msg.sender][
recipientComission
] = true;
delegatedStakeUsers[msg.sender].push(recipientComission);
}
_delegateStake(
msg.sender,
recipientComission,
recipientCommissionAmount
);
userAmount -= recipientCommissionAmount;
}
}
// code
}
deposit 함수 내 커미션 분배 로직에서 문제가 발생한다.
부계정 입금 시 for 루프를 통해 부모 계정(commissionParents)에 커미션을 분배한다. 부모가 Level 5면, 12% 커미션을 부모(Lv 5) 계정으로 할당한다.
_delegateStake에서 커미션을 실제로 배분하는데 이때 부모(=본인)의 Level 5 계정으로 12%를 받고, 실제 프로토콜(recipientComission 주소)에는 2%만 납부하게 된다.
결국, 전체 커미션 14% 중 2%는 프로토콜, 12%는 본인에 전가된다. 혼자 계정 트리를 구성해 커미션의 대부분을 되돌려 받아 실질적으로 할인된 수수료만 내고, 나머지는 모두 편취하게 된다.
레벨이 높은 계정(5레벨)이 신규 계정의 부모로 얼마든지 지정될 수 있고 부모-자식 관계에 대한 신뢰성 검증이 부족해서 발생하는 취약점이다.
레퍼런스
Smart Contract Vulnerability Dataset - Cyfrin Solodit
h-01-users-with-level-5-account-may-bypass-the-applied-12-commissions-shieldify-none-terplayer-bvt-stakingdistribution-markdown
solodit.cyfrin.io
audits-portfolio-md/Terplayer-BVT-Staking&Distribution-Security-Review.md at main · shieldify-security/audits-portfolio-md
Contribute to shieldify-security/audits-portfolio-md development by creating an account on GitHub.
github.com
'web3 > Solodit Report' 카테고리의 다른 글
[Solodit] Withdrawal Calculation Causes Underflow, Locking All User FundsTerplayer Bvt Staking&Distribution (0) | 2025.09.22 |
---|