As far as I know (without any legal training) - if you list the text or code or whathaveyou as "anonymous", you're OK.
I believe that by listing it as anonymous you're indicating you do not know where it came from, but you're admitting you didn't create it as original work.
Extending from that, you should be open to the actual author being able to prove they are the author, and changing your usage to reflect their name/license/copyright/whatever.
You should check with an Intellectual Property lawyer for details and corrections to my understanding.