They can poison players with their ranged attack (about 25-49 damage per hit, once every few seconds, over 3 minutes), which can be negated by various means, or simply healed with food. Antipoison is an affordable option for low level players, which their swamp tar and other drops could easily pay for. Since they need to deal damage with an attack to inflict poison, melee armour helps reducing the frequency.
Previously, equipping an anti-poison totem would not prevent Cave slimes and certain other poisonous monsters from causing poison. On 15 June 2010, Jagex implemented a fix that addressed the issue. However, during the fix, cave slimes were overlooked, and could still cause poison even if the player was holding the anti-poison totem. As of 21 September 2010, this glitch has been fixed (the exact date of the fix is unknown, and most likely occurred in a hidden update).
Despite being poisonous, cave slime can apparently be safely eaten as green gloop soup, part of Dorgeshuun cuisine.