134 million credit cards were stolen from Heartland's payment systems.
The hackers used one technique — SQL injections.
Here's how it works:
SQL injection is a type of attack where the attacker runs damaging SQL commands by inserting malicious SQL code into a web application input field or URL.
For example, imagine a web app that returns all your information after logging in. That query may look like the following:
SELECT * FROM users
WHERE username = 'USER_INPUT';
If an attacker were to submit a malicious input, the query could change to the following:
SELECT * FROM users
WHERE username = '' OR '1'='1';
This query will return all users as '1'='1' will always return true.
You can protect your system from SQL injection by doing the following:
1. Use prepared statements or parameterized queries:
User input cannot be executed because prepared statements and parameterized queries ensure a distinct separation between user input and SQL code.
2. Validate and clean inputs:
Use expected formats and constraints to validate user input, and clean inputs to get rid of characters that may be interpreted as SQL code.
3. Follow the least privilege principle:
Limit the permissions for database accounts used by applications and services to only what is required for their functionality. This limits the system's vulnerability to SQL injection attacks.
Want more engineering insights like this?
Subscribe to our free newsletter for a weekly roundup of all our best content:
Non-primitive data structures are made up of primitive data types like integers, characters, floats, or booleans to make complex structures. They help arrange data in a way that makes operations easier and faster to complete.
Linear data structures are used to arrange items sequentially and in a specific order. They can be traversed in a linear fashion, which makes them ideal for organizing and manipulating data when access, insertion, or removal must take place in a specific sequence or place.
Give me 5 minutes and I'll teach you everything about inheritance in object-oriented programming (includes Python code):
Single inheritance:
This kind of inheritance is the simplest and most typical. It creates a single-level hierarchy where a parent's properties and methods are passed down to child classes.
Multiple inheritance:
A child class can inherit traits & functions from several parent classes thanks to multiple inheritance.
Despite being a powerful technique, it may also increase complexity & lead to problems like tight coupling.