{"id":7693,"date":"2019-09-16T15:06:37","date_gmt":"2019-09-16T14:06:37","guid":{"rendered":"https:\/\/staging-site.42crunch.com\/?p=7693"},"modified":"2022-09-24T16:16:29","modified_gmt":"2022-09-24T15:16:29","slug":"we-need-the-controller-layer-back","status":"publish","type":"post","link":"https:\/\/staging2022.42crunch.com\/we-need-the-controller-layer-back\/","title":{"rendered":"We Need the Controller Layer Back!"},"content":{"rendered":"

A couple days ago, I gave an API security workshop to highlight the OWASP Top 10<\/a> issues for APIs and some of the mistakes we keep doing at development time and pay for at runtime.<\/p>\n

Many of the issues related to data, such as improper data filtering, mass assignment or excessive data exposure, could be avoided if data was controlled in a specific layer of the architecture. When I started in IT, a proper application would respect the MVC architecture: we had a model (data), a view (UI) and a controller layer. Never would have we exposed the data straight to the UI and hoped for the best!<\/p>\n

But here is what we see now: we have data in a MongoDB database, we point a tool at it that exposes CRUD operations on top and we call the output a REST API (for the record, that is not a REST API, but it’s matter for another blog). Then we expose that API to the world and let the UI filter and manipulate the information. What are the results of that approach?<\/p>\n