Submitted by cmichel, also found by WatchPug, jonah1005, gzeon, and TomFrench
The approve function has not been overridden and therefore uses the internal shares, whereas transfer(From) uses the rebalanced amount.
The approved spender may spend more tokens than desired. In fact, the approved amount that can be transferred keeps growing with pricePerShare.
Many contracts also use the same amount for the approve call as for the amount they want to have transferred in a subsequent transferFrom call, and in this case, they approve an amount that is too large (as the approved shares amount yields a higher rebalanced amount).
The _allowances field should track the rebalanced amounts such that the approval value does not grow. (This does not actually require overriding the approve function.)
In transferFrom, the approvals should then be subtracted by the transferred amount, not the amountInShares:
tabshaikh (Badger) confirmed and resolved:
