Consumer Reports said on Wednesday it had found "concerning" levels of lead and cadmium in a third of various chocolate products it tested recently, and called on Hershey to reduce the amounts of heavy metals in its chocolate.
I mean they kinda do, the cacao tree pulls those elements (cadmium) out of the soil or the cacao is in contact with soil containing those elements during processing. Many brands have issues with lead and cadmium but it can be mitigated by choosing a better supplier, frequent testing, and protecting product better during shipment. Mentioning Hershey's is going to draw a lot of attention especially right before Halloween but it's a common issue in chocolate.
Edited with some corrections. Also mrchampion pointed out further down in this thread that it is likely the lead contamination comes from leaded gasoline during shipment.
The article mentions that the cadmium can largely be mitigated by preventing the beans from touching dirt in the drying process and shielding them from heavy metal dust. The lead though is probably introduced at the factory, and that's obviously a problem but not immediately clear where it's being introduced.
It also mentions that the only likely reason milk chocolate doesn't have these unsafe levels is because the dairy content reduces the amount of pure chocolate requires for the mix. So both milk and dark chocolate are bad, it's just milk chocolate has cocoa in it and thus less heavy metal.
mrchampion corrected another comment of mine in this thread that links studies saying the lead might change from leaded gasoline used during the shipping process.
This publishing (PDF) does seem to indicate the is done degree of bioaccumulation of cadmium in the cacao plants though.