"The pathogenic bacteria, those are the ones that are the most concerning," she said. All of the sharing sites urge women to collect, store and send milk in sanitary ways and to offer medical proof that the milk is safe. It's not clear, however, how many suppliers follow those instructions.
Keim's team sought samples through classified ads on the OnlyTheBreast site, where they were able to buy milk for between 50 cents and $3 an ounce.
They didn't obtain samples from the sharing sites because of the need for anonymity, but Keim said contamination is possible whenever strangers offer to supply—and, often, ship—unscreened milk.
Of 495 inquiries sent, 191 sellers never replied and 41 stopped corresponding after one reply, Keim wrote. Some 79 sellers agreed to send milk but never followed through and eight accepted payment but didn't send the promised product.
(Read more: Healthy Gen Yers won't buy Obamacare: Wilbur Ross)
Of the 101 samples analyzed, 72 were contaminated with bacteria and would not have met criteria for feeding without pasteurization set by the Human Milk Banking Association of North America, or HMBANA.
That's a network of a dozen milk banks in the U.S. and Canada that supply donor milk, typically through health care providers and hospitals. Because the supply is scarce, the banked milk is limited to use in premature and medically fragile babies through medical prescriptions, said Kim Updegrove, president of HMBANA.
All donors are strictly screened and medically tested, and the milk is pasteurized to prevent contamination that could harm a baby, said Updegrove. That causes some slight loss of nutrition, she acknowledges, but reduces risk.
"I don't think that the general public understands human milk as a bodily fluid that can relay dangerous bacteria and viruses," she said.
The federal Food and Drug Administration and the American Academy of Pediatrics both warn women not to feed babies breast milk acquired directly from individuals or through the Internet.
(Read more: Work may be tiring, but it beats parenthood)
Breast milk can transmit infections such as HIV and tuberculosis and can also pass on prescription or illicit drugs. Those risks, combined with the evidence of harmful bacteria, should make new moms think twice about buying milk from strangers, Updegrove said.
"I long to have people view this the way that they view blood products," she said. "You would never say, 'I'm a little bit anemic,' and hand off the tubing."
The trouble is that women who can't breastfeed or produce enough milk themselves have few options unless their babies are sick enough to receive milk from a bank, which typically costs between $3.50 to $6 an ounce.
Allison Jones, 35, of Columbus, Ohio, wasn't able to make enough breast milk for her son, Charlie, who was born more than three months prematurely in May weighing 1 pound, 2.3 ounces. Because he was so early, he was able to obtain milk through a local bank, but if that weren't an option, she might have considered looking online.
(Read more: Teaching kids charity? Skip the soup kitchen trip)
"I can definitely see the appeal," she said. "We're told breast milk is fantastic—and it is. But you don't really know the person donating."
New mothers who have problems nursing should work with their pediatricians to find other options. Lactation experts can help resolve many feeding problems, Updegrove said.
If that doesn't help, Updegrove says commercial formula, though not ideal, is a better option than potentially unscreened breast milk from an unknown source.
"While it's certainly not ideal, if you have a healthy, full-term infant, that infant is likely to do just fine on formula," she said. "I long to have people see breast milk as a bodily fluid that contains all the benefits, but all the risks, of other bodily fluids."
—By JoNel Aleccia, NBC News