A SIM swap attack manipulates the process of transferring phone numbers across mobile carriers and subscriber identity modules (SIMs) to misdirect text messages intended for the victim to the attacker instead. If you use SMS for two-step authentication on Stripe, the attacker can use this method to obtain your verification codes, thereby gaining access to your account.
A SIM card is issued to every mobile phone customer and slotted into a phone to identify the customer. A phone number ultimately points to a single SIM. Recently, eSIMs were introduced to eliminate the physical card, but otherwise function the same way.
Your mobile carrier has the ability to change which SIM a phone number points to. This is needed so you can keep the same phone number if you lose your phone or if the SIM card is otherwise damaged or unusable. This also means employees at the mobile carrier has the power to make this change.
Additionally, in many countries, it is required by law that customers can freely switch between mobile carriers. This encourages healthy competition, but also means that mobile carriers do minimal verification before allowing a phone number to be ported to a different carrier, which naturally issues a new SIM.
There are several different ways the attack can work with ultimately the same result:
In all cases, the attacker obtains a SIM card that receives SMS and phone calls from your phone number, while your existing phone stops working.
In general, due to third parties involved, there is currently no way to prevent SIM swap attacks. The only way to protect yourself from its harmful effects is to stop using text messages (SMS) for two-step authentication.
As long as SMS for two-step authentication is enabled, your account is at risk. You should enable an alternative method for two-step authentication, such as an authenticator app or a hardware security key, and then disable SMS.