Late last year, David Nichols, a chemist at Purdue University in West Lafayette, Indiana, received a disturbing email. Sent by a colleague, the message contained a link to a newspaper article on "legal highs", those obscure substances that mimic illegal drugs in every way but their illegal status. To Nichols's dismay, the article named him as being "especially valuable" to entrepreneurs who scoured the scientific literature for compounds to turn into the next street drug.

Nichols has been synthesising and studying drugs for nearly 40 years in the hope of improving human wellbeing. He has worked on drugs that show promise in treating the symptoms of Parkinson's disease and schizophrenia. But it was his research on other substances, including the psychedelic compounds LSD and mescaline, that drew interest from the purveyors of legal highs.

Writing today in the journal Nature, Nichols says he is haunted by the potential disasters that abuse of his research might bring. His own studies never look at whether a substance is safe to use as a recreational drug, so an underground chemist who exploited his work would be manufacturing and selling a highly experimental drug that has not been tested on humans. "It really disturbs me that [these people] have so little regard for human safety and human life that the scant information we publish is used by them to push ahead and market a product designed for human consumption," he writes.

There is nothing new in Nichols's uneasiness. He realised amateur chemists were keeping an eye on his papers more than a decade ago. His lab was investigating how ecstasy (MDMA or 3,4 methylenedioxymethamphetamine) worked in the brain, because chemicals like it might help in psychotherapy. One compound, called MTA, was similar to MDMA and blocked an enzyme that breaks down serotonin, a feel-good chemical in the brain.

Nichols published three papers on MTA in the mid-1990s. Soon afterwards, and without his knowledge, the substance was manufactured as a recreational drug and sold in tablet form. Some people who took the pills died. The tablets had been sold under the name "flatliners". By 2002, the drug had been linked to six deaths. "It did not help that I knew some of these fatalities were associated with the use of multiple drugs, or had involved very large doses of MTA. I had published information that ultimately led to human death," Nichols writes.

In a recent video interview with the Guardian, John Ramsey, a toxicologist who runs a drugs database at St George's Medical School in London, said that while the pharmaceutical industry spends hefty sums on clinical trials to ensure new drugs are safe before they reach the market, "these people are really experimenting on teenagers."

Research papers on psychoactive substances are a gift for street drug entrepreneurs. When mephedrone was made illegal in the UK and across Europe last year, they had a ready supply of other compounds that were simply too new to be banned. The ever-changing list of compounds now sold as legal highs is nearly as mindbending as the drugs that appear on it.

What is a responsible scientist to do? Nichols has decided not to study one very toxic compound, but concedes that the molecules he has reported in journals could still be dangerous at high doses or in combination with other substances. His fear is that a seemingly innocuous substance becomes a hit in the clubs and only later is found to cause serious health problems, such as life-threatening kidney damage.

"That would be a disaster of immense proportions," he writes. "This question, which was never part of my research focus, now haunts me."

For more on legal highs, see this Observer drugs special.