This is a canonical quote, and it’s rather lovely. It’s from the Samyutta Nikaya, and in Bhikkhu Bodhi’s translation you’ll find it on page 708:
“Therefore, bhikkhus, you should train yourselves thus: ‘We will develop and cultivate the liberation of mind by lovingkindness, make it our vehicle, make it our basis, stabilize it, exercise ourselves in it, and fully perfect it.’ Thus should you train yourselves.”
“Having gone on his almsround, the sage should then go to the forest, standing or taking a seat at the foot of a tree. The enlightened one, intent on jhana, should find delight in the forest, should practice jhana at the foot of a tree, attaining his own satisfaction.” The Buddha
The Buddha. (Source: Nalaka Sutta, Sutta Nipata.)
This is a saying from the Pali canon, upadhi dukkhassa mūlanti, which means “Attachment is the root of suffering.” So this is a genuine canonical quote.
You’ll find it in this sutta, but translated by Thanissaro as “Acquisition is the root of stress.” His translations are rather idiosyncratic.
In this translation of the same sutta it’s “acquisition is the root of suffering.”
Bhikkhu Bodhi’s translation (not available online, but in The Middle Length Discourses of the Buddha, page 868) has “attachment is the root of suffering,” although he sometimes has “acquisition” in place of “attachment,” in various repetitions of the phrase.