HIGH severity: Starlink — Misconfiguration in `transfer` function. StarlinkCoin contract used the `_transfer` function to transfer funds, which incurs a fee when funds come from the LP contract. The attacker used the `skim` method to directly transfer funds to the LP contract, and the fee was also deducted, causing a change in the proportion of the two tokens in the trading pair contract. The attacker then exchanged the tokens for a profit and left the contract.. https://twitter.com/NumenAlert/status/1626447469361102850 https://twitter.com/bbbb/status/1626392605264351235

Vulnerable code:
function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual override {
        if (
            botAddresses[sender] &&
            amount > antiBotAmount &&
            antiBotTime > block.timestamp
        ) {
            revert("Anti Bot");
        }

        uint256 contractTokenBalance = balanceOf(address(this)); 

        if (contractTokenBalance >= _maxTxAmount) { 
            contractTokenBalance = _maxTxAmount; 
        }
        
        bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity;

        bool buyLp = buyIndex >= buyIndexSellLiquify;

        if (
            overMinTokenBalance && 
            !inSwapAndLiquify && 
            sender != uniswapV2Pair && 
            swapAndLiquifyEnabled 
        ) {
            contractTokenBalance = numTokensSellToAddToLiquidity;
            swapAndLiquify(contractTokenBalance);
        }

        if (recipient == uniswapV2Pair) {
            if (
                sender != address(this) &&
                recipient != address(this) &&
                !_isExcludedFromFee[sender]
            ) {
                if (
                    overMinTokenBalance && 
                    !inSwapAndLiquify && 
                    sender != uniswapV2Pair && 
                    swapSellLiquifyEnabled 
                ) {
                    contractTokenBalance = numTokensSellToAddToLiquidity;
                    swapAndLiquify(contractTokenBalance);
                }
                uint256 _fee = amount.mul(sellFeeRate).div(100);
                super._transfer(sender, mintContract, _fee.mul(LPSellFees).div(sellFeeRate));
                super._transfer(sender, addressForMarketing, _fee.mul(marketSellFees).div(sellFeeRate));
                super._transfer(sender, BurnAddr, _fee.mul(burnSellFees).div(sellFeeRate));
                amount = amount.sub(_fee);
            }
        } else if (sender == uniswapV2Pair) {
            if (
                sender != address(this) &&
                recipient != address(this) &&
                !_isExcludedFromFee[sender]
            ) {
                if (
                    overMinTokenBalance && 
                    !inSwapAndLiquify && 
                    buyLp &&
                    swapBuyLiquifyEnabled 
                ) {
                    contractTokenBalance = numTokensSellToAddToLiquidity;
                    swapAndLiquify(contractTokenBalance);
                    buyIndex = 0;
                }
                uint256 _fee = amount.mul(buyFeeRate).div(100);
                super._transfer(sender, mintContract, _fee.mul(LPBuyFees).div(buyFeeRate));
                super._transfer(sender, addressForMarketing, _fee.mul(marketBuyFees).div(buyFeeRate));
                super._transfer(sender, BurnAddr, _fee.mul(burnBuyFees).div(buyFeeRate));
                amount = amount.sub(_fee);
                buyIndex = buyIndex + 1;
            }
        }
        
        super._transfer(sender, recipient, amount);
    }

Vulnerability type: Flashloans, Misconfiguration, skim