Submitted by bin2chen, also found by AkshaySrivastav, hihen, and 0xsomeone
Using temporary variables to update balances is a dangerous construction.
If transferred to yourself, it will cause your balance to increase, thus growing the token balance infinitely.
KIBToken overrides \_transfer() to perform the transfer of the token, the code is as follows:
From the code above we can see that using temporary variables newToBaseBalance to update balances.
Using temporary variables is a dangerous construction.
If the from and to are the same, the balance[to] update will overwrite the balance[from] update.
To simplify the example:
Suppose: balance[alice]=10 ,  and execute transferFrom(from=alice,to=alice,5)
Define the temporary variable:  temp_variable = balance[alice]=10
So update the steps as follows:
After Alice transferred it to herself, the balance was increased by 5.
The test code is as follows:
add to KIBToken.transfer.t.sol
A more general method is to use:
In view of the complexity of the amount calculation, if the code is to be easier to read, it is recommended
Alex the Entreprenerd (judge) commented:
m19 (KUMA) confirmed and commented:
m19 (KUMA) mitigated:
