I am using the Django Rest Framework for my backend and React for my front, and they are served in different domains and subdomains, and now I am completely confused about what I should do to secure my APIs from XSS and CSRF attacks. I wish to use simple-JWT for the application, but my research showed that it is vulnerable to XSS. And if I store them in http-only cookies, they can't be accessible on the front end to add them to the authorization header, and it would be like using sessions. What should I do? And what is the best practice for securing APIs?
I also used dj-rest-auth package, but it was a little bit tricky, if someone used this module it would be grate to hear the experience. I would be glad to hear your suggestions.