Submitted by sl1, also found by 0xDemon, 0xGondar, 0xKann, ABAIKUNANBAEV, Abhan, boredpukar, ctmotox2, ctmotox2, curly, dhank, EPSec, fyamf, fyamf, m4k2, peanuts, pulse, rspadi, Shinobi, spuriousdragon, yuza101, and zanderbyte
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_VestingDeployer.sol#L141-L144
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_VestingDeployer.sol#L176-L183
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_VestingDeployer.sol#L218-L231
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_VestingDeployer.sol#L193-L206
Vesting plans are created by token issuers in the VestingDeployer contract. When a vesting plan is created, a new StepVesting contract is deployed.
SecondSwap_VestingDeployer.sol#L119-L129
This contract address will be used by token issuers to manage their vesting plans. However, currently its possible that a creator of one vesting plan can affect vesting plans created by other users.
Token issuers are set by the admin in the setTokenOwner() function. 
SecondSwap_VestingDeployer.sol#L141-L144
As can be seen, its possible for a token to have multiple owners, as the mapping used is owner => token instead of token => owner. Now if one token has multiple owners and there are 2 vesting plans, creator of vesting plan A can influence vesting plan B and vice versa.
createVesting() and createVestings() functions check that token that is linked to the msg.sender is the same as the token of the vesting plan, which in this case will be true regardless of the fact that msg.sender is not the creator of said vesting plan.
SecondSwap_VestingDeployer.sol#L176-L183
But when _createVesting() function of the StepVesting contract will be invoked, it will transfer funds not from the msg.sender but from the actual creator of the vesting plan.
SecondSwap_StepVesting.sol#L306-L308
transferVesting() function is also vulnerable to that issue because it uses the same check as createVesting().
SecondSwap_VestingDeployer.sol#L218-L228
Creator of one vesting plan can influence vesting plans created by other users.
Store the address of the vesting plans creator in a mapping(address vestingPlan => address creator) and check if the msg.sender is the actual creator of the vesting plan.
Koolex (judge) commented:
