Is app_api request protected from CSRF attacks on CORS routes?

  • I want to setup apps using app_api
  • In CORSMiddleware.php, I see a comment like the below:

// ensure that @CORS annotated API routes are not used in conjunction
// with session authentication since this enables CSRF attack vectors

Why do you think it is not safe?

  • ‘app_api’ session key is set only after AppAPIAuth check is valid (Authentication — AppAPI latest documentation) for the request from the ExApp, which we don’t need to secure from, as registered ExApp is trusted.
  • ExApps doesn’t have session
  • ExApps doesn’t work with cookies