There are several common causes of hard masses around the anus: 1. It may be a perianal abscess. Diarrhea or food that stimulates the diet sometimes leads to infection of the anal glands, which then spreads along the anal canal to the perianal area to form an abscess. This is the first time I’ve ever seen an abscess in my life. This is a good way to get the most out of your life. So there are many reasons for a hard mass next to the anus, and a rectal exam should be performed, and if necessary, ancillary tests, such as perianal ultrasound, can be performed to clarify the diagnosis.