Caterpillars with hairs or spines should be approached cautiously because they can release toxins that damage skin or cause allergic responses. Many caterpillars have glands in the epidermis that produce these toxins. The Brazilian caterpillar, Lonomia obliqua, causes mild burning pain in most people, but can cause more severe symptoms. This caterpillar lacks epidermal glands, but other related caterpillars have been found to have toxin gland cells within the spine itself.
Source: Living With Insects Blog