STIs can be passed on from one person to another during any sexual activity that involves insertion of penis. The risk of getting HIV infection during anal sex is 5 times higher compared to unprotected vaginal sex. Thus it is advised to use condoms during anal sex.
When a latex condom is used for anal sex, it is important to use a water-based or a silicone-based lubricant to keep the condom from breaking. Other lubricants are not recommended as it would react with the latex leading to condom tearing.