Molnupiravir works by incorporating itself into the genetic material of the virus, and then causing a huge number of mutations as the virus replicates, effectively killing it. In some lab tests, the drug has also shown the ability to integrate into the genetic material of mammalian cells, causing mutations as those cells replicate.
If that were to happen in the cells of a patient being treated with molnupiravir, it could theoretically lead to cancer or birth defects.