December 2018
Beginner to intermediate
796 pages
19h 54m
English
The countermeasure against an SQL injection is fairly simple. Use the Django ORM rather than crafting SQL statements by hand. The preceding example should be implemented as follows:
User.objects.get(username=name).email
Here, Django's database drivers will automatically escape the parameters. This will ensure that they are treated as purely data and, therefore, they are harmless. However, as we will soon see, even the ORM has a few escape latches.
Read now
Unlock full access