Despite regulations, unreliable labeling on edible marijuana products is a problem: who wants to scarf down a medicated cookie labelled as containing 20mg of THC, only to find it packs a 40mg punch? Not fun.

In a recent study, researchers at John Hopkins University found that only 13 of the 75 labels they looked at on edible cannabis products accurately listed the product's levels of THC.

"The majority of the products we tested were inaccurately labeled," said study author Ryan Vandrey."If this study is representative of the medical cannabis market, we may have hundreds of thousands of patients buying cannabis products that are mislabeled."

The problem can be traced back to the fact that cannabis is still, at least on the federal level, illegal: neither the FDA or the U.S. Department of Agriculture - both bodies typically tasked with overseeing food and drug labeling - can implement quality assurance regulations for edibles when they're against the law. "The solution is implementing oversight and regulations requiring accurate labeling - the same as you have for all other medicine," Vandrey said.

A new test offers a solution

A group of scientists says it has a potential solution to the testing problem. Researchers Melissa Wilcox, Jahan Marcu and colleagues placed cannabis-infused foods into a cryo-mill, or grinding jar continually cooled with liquid nitrogen. Then they added a silica-based compound and ground the mixture to create a homogenous sample.

"They separated out the various chemical components using a technique called flash chromatography," Grace Discovery Sciences said in a statement. "This allowed them to inject liquid containing only the cannabinoids into a high-performance liquid chromatography device (HPLC) for analysis. The researchers concluded this process could yield far more accurate and reliable measurements of THC and/or CBD levels in an edible product than was previously possible."

It's important work - and not just to prevent recreational users from consuming too much and having a bad time: for medical users, reliable dosage information can be a matter of life and death. As Vandrey tells LiveScience, "if a product actually contains less of a certain compound than what the label states, you are paying money and expecting to get a certain amount of medicine, and you are not getting what you think you are getting."

While the testing process hasn't been perfect yet, it has been used successfully to measure cannabis content in gummy bears, brownies, cookies and certain topical lotions. According to Marcu, the next step is to install this equipment in commercial labs and train technicians to use it on a larger scale.

This research was presented at a meeting of the American Chemical Society on March 15, 2016.