“Nothing can harm you as much as your own thoughts unguarded” is commonly found attributed to the Buddha. It’s also seen as “Nothing can harm you as much as your own unguarded thoughts,” where the wording is more natural.
In fact there is a scriptural quotation that is very close. In the Anguttara Nikaya there’s:
I don’t envision a single thing that, when unguarded, leads to such great harm as the mind. The mind, when unguarded leads to great harm.
This is undoubtedly the prototype, and it’s a close enough paraphrase that it would be unfair to call it fake. If you’re looking to quote this, though, why not go for the more accurate version?