Hook
More breakout videos from this creator.
Hey man here's the architecture for the restaurants API for the food ordering app. Looks nice and cheap. Can you walk me through how a get request might look to our database? The APIs are super simple. We just have this get request and users can put in whatever name they want for a restaurant and that's just gonna directly go straight into this sequel query to get the information. Wait, you're using user entered information directly in a sequel query? What if they do something like 1 equals 1? Huh? So because 1 equals 1 is true, this is just gonna return our entire table to them. Yeah. And they can use that same syntax to run any sequel command they want. Yeah. I mean, I guess all they're doing is just reading our table. Restaurants anyways, okay. Run a command like drop table. Wait. Because this is my API, they can literally drop the entire restaurant's table and delete our whole database? Yes. But SQL injection has literally been around for decades. So there's so many easy ways to prevent it. Something like this, haha. Okay. Oh, okay. I see. This is really nice and an easy fix. Thanks bro.