Short answer
It's a mild risk. Raw pesto contains garlic, which is toxic to cats, and the cheese and pine nuts can upset their stomach. Watch your cat for vomiting, diarrhea, or lethargy over the next day. If you see any of these signs, call your vet for advice.
Pesto — Food safety facts
Feed with care · Cats · full breakdown on the linked food page
Built on garlic, which is toxic to dogs and cats, plus pine nuts and cheese.
The full verdict, portion guidance and serving notes are collected on the Pesto food facts page.