The claim that NASA confirmed the extraterrestrial origins of cannabis is, unfortunately, false.
Back in 2016, the popular science website IFL Science posted an article titled 'Marijuana Contains "Alien DNA" from Outside of Our Solar System, NASA Confirms.' The post was, of course, a hoax, designed to show that social media users commonly share articles without actually reading anything more than the headline. The post was a social experiment of sorts for the website.
"We here at IFLS noticed long ago that many of our followers will happily like, share and offer an opinion on an article—all without ever reading it," reads the original article.
While IFLS had proven their point, they had also created a very viral piece of misinformation which has continued to crop up on clickbaity websites even 2 years later.
So while cannabis has probably been growing in Europe longer than people have lived there, it was not a gift from our alien overlords.