Rotten Food
Supermarkets and other food retailers are required by law to dispose of food that has reached a "sell by" date. Dumpster divers may see these dates as flexible, and it could lead to the consumption of food that has spoiled. An article in Mother Nature News notes that some perishables like dairy and meat can develop harmful bacteria relatively quickly if allowed to come to room temperature. How many refrigerated dumpsters do you know of?
Sabotaged Food
Rude dumpster divers often make a mess for store owners, tossing garbage on the street as they tunnel for "gold" at the bottom of the heap. To counteract this, some stores may sabotage food by pouring on bleach or soap.
Sharp Objects, Rodents, and Other Hazards
Stores may share dumpsters, and dumpsters may contain more than food. Dumpsters may -- rarely -- contain medical waste or sharp objects such as needles. Objects in the dumpsters may be broken and sharp. Free food isn't just attractive to humans. Animals may be "trained" to rely on human scraps for food. Rats and racoons may share the dumpster with you.
The Danger of Arrest
Dumpster diving may be illegal in your community. If it isn't, there still may be legal hazards. Breaking a lock on a dumpster or otherwise damaging it can lead to police attention. Cities and towns may be willing to tolerate dumpster divers scavenging for food, but they pass laws against it because of fears that sophisticated criminals use dumpster diving to obtain personal information to commit identity theft.