ORM is for reducing chance of SQL Injection![]()
Yes. But there are many careless developers who don't use parameter bindings. They just concatenate the queries with user inputs. So it's not solved yet!BS. SQL already solved(not even reduce) this problem with Parameter Bindings.
https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html
https://blog.saeloun.com/2019/10/28/bind-parameters-in-activerecord-sql-queries/#:~:text=Bind parameters are a way,Preventing injection attacks by quoting
Parameter Binding is not the same query escaping technique before it.
One thing both techniques cannot solve is incompetence.
Personally I will NEVER consider a software developer knows RDBMS unless he/she knows SQL well. Learning SQL and learning it more than just the simplistic CRUD operations exposes the person to the real power of RDBMS because SQL is just a command language, what a software developer really need to understand is how the data is manipulated and processed within the database so that you know why you want to design it that way.
The video I just shared is just a thin flake of icing on top of the iceberg of understanding RDBMS. But even that thin flake will bring you further than abstracting yourself away from the RDBMS using ORM.
One is in flavour of exposing you to RDBMS technologies, the other is in flavour of abstracting you from RDBMS. It is a fallacy thinking that you will keep changing from one database type to another across projects and really across all the different variants of RDBMS, they are not all so different. ORM simply add on quite a fair bit of complexity and overheads to give you this abstraction which most of the time you don’t even need it. How often your projects jump between databases and how often you uses database specific features for more than 80% of your work accessing the database when using SQL?
If you do have a project that uses multiple variants of RDBMS which in my opinion is rare, a simple DAO design that uses polymorphism and factory design would solve abstract the problem from the rest of the code.
![]()
Yes. But there are many careless developers who don't use parameter bindings. They just concatenate the queries with user inputs. So it's not solved yet!
I would like my developers (even the worst) to be protected by default. Like the new JS framework like REACT have default protection against XSS unless the developers do something specialIt is solved. What is not solved as I have already mentioned is Incompetence. What you have mentioned is incompetence in the engineers to choose the tool. It is a solved problem to protect your home with locks to most petty burglars, but it is incompetence if one doesn’t lock the door.
![]()
Fewer XSS bugs appear in applications built with modern web frameworks. These frameworks steer developers towards good security practices and help mitigate XSS by using templating, auto-escaping, and more. That said, developers need to be aware of problems that can occur when using frameworks insecurely such as:
[LIST]
[*][I]escape hatches[/I] that frameworks use to directly manipulate the DOM
[*]React’s dangerouslySetInnerHTML without sanitising the HTML
[*]React cannot handle javascript: or data: URLs without specialized validation
[*]Angular’s bypassSecurityTrustAs* functions
[*]Template injection
[*]Out of date framework plugins or components
[*]and more
[/LIST]
I would like my developers (even the worst) to be protected by default. Like the new JS framework like REACT have default protection against XSS unless the developers do something special
Fewer XSS bugs appear in applications built with modern web frameworks. These frameworks steer developers towards good security practices and help mitigate XSS by using templating, auto-escaping, and more. That said, developers need to be aware of problems that can occur when using frameworks insecurely such as: [LIST] [*][I]escape hatches[/I] that frameworks use to directly manipulate the DOM [*]React’s dangerouslySetInnerHTML without sanitising the HTML [*]React cannot handle javascript: or data: URLs without specialized validation [*]Angular’s bypassSecurityTrustAs* functions [*]Template injection [*]Out of date framework plugins or components [*]and more [/LIST]