Lecture on inference attacks in databases: how users combine permitted query results and metadata to reveal restricted data, plus prevention methods at design time and query time.
Key Takeaways
- Inference lets authorized users derive restricted data by linking results of individually permitted queries and metadata.
- Harmless individual data items can become sensitive when combined with dependency knowledge.
- Prevention is possible at database design time by splitting dependent data into separate tables with finer access rules, at the cost of rigidity and availability.
- Query-time detection can block suspicious query sequences but is complex and hard to generalize.
What the video covers
- Inference is an attack where a user with authorized access combines results of permitted queries to learn data they are not authorized to see, without hacking the system.
- A typical example: one view shows employee number and name, another shows number, name, rank and department, and a third shows rank, department and salary, letting the user indirectly infer each employee's salary.
- The inference problem arises when each piece of data is individually classified as non-sensitive, yet combining them breaks the access control policy.
- Key components are non-sensitive data and metadata, meaning knowledge of dependencies and correlations between data items, such as functional dependencies from normal forms.
- An inference channel is the path through which unauthorized information flows to the user.
- Example: since each department has one head, the highest salary in a department reveals the department head's salary.
- Two main inference techniques are analyzing functional dependencies and merging views that share the same constraints, where records can be linked by their order.
- Prevention has two approaches: detection during database design (splitting tables and applying finer-grained RBAC) and detection at query time (monitoring and rejecting queries that open inference channels).
- Design-time prevention makes access control strict and rigid, reducing availability and speed of access for authorized users.
- Query-time detection requires complex algorithms that analyze security rules and data relationships, and results cannot be generalized across all databases.
Chapters
- 00:00Introduction to Inference Attacks
- 01:00Example Using Employee Views
- 02:00Non-Sensitive Data, Metadata and Inference Channels
- 05:30Inference Techniques: Functional Dependencies and Merged Views
- 05:56Prevention Approaches Overview
- 07:17Design-Time Detection and Table Splitting
- 08:57Query-Time Detection and Monitoring
- 12:00Challenges and Conclusion
Full Transcript — Download SRT & Markdown
Speaker A
In the name of God, the Most Gracious, the Most Merciful. We continue with chapter five. Today, in section 5.6, we will talk about inference. Inference is a type of attack that occurs on the database, violating the database access
Speaker A
control okay? How will it reach the data? It will reach the data by analyzing the links between whom? Between the results of the queries.
Speaker A
So, inference is me trying to get data or information and linking data together from queries that I am authorized to execute okay?
Speaker A
And obtaining information that I am not authorized to know. Okay. Users combine information they may access to discover information they may not access. For example, you have a view that shows you the employee number and their name, okay?
Speaker A
And the second view shows you, for instance, the employee number, their name, their rank, and the department.
Speaker A
And you have another view that shows the rank, department, and salary. You are not allowed to know this employee's salary, but you were able to link the data from the first query with the second query, so you were able to
Speaker A
know indirectly who? The salary of each of the employees. Okay? What do we call this? We call it inference, okay?
Speaker A
The user does not hack the system or read forbidden records; they simply collect small pieces they are allowed to access.
Speaker A
Query after query, they combine the results of these queries to form a complete picture they were not supposed to have, okay?
Speaker A
So, what is the problem with inference? When does it occur? And what are its main components? The inference problem appears when...When every piece of data is classified as non-sensitive.
Speaker A
Meaning harmless data can still break the access control policy. Since each one of them is considered harmless or non-sensitive, according to the access control policy for your database access permissions, you are allowed to see each type or piece of
Speaker A
data separately. Where does the problem lie for us? If a user simply comes along—a user who is already authorized to access the data —and collects these elements together, they can then know data they were not authorized to know in full.
Speaker A
These are our main components: non-sensitive data, which is our actual data, and metadata, which describes the data, through which they can deduce the relationships between the data and the tables okay?
Speaker A
And consequently, they can reach whom? To the data. So, what is metadata and the inference channel? Metadata, as the name suggests, "meta" means descriptive data. It is the knowledge about correlations or dependencies among data items. So, it is knowing the
Speaker A
correlations and dependencies between whom? The data. Meaning when I tell you that the department number depends on the department name, or for example, it depends on the department name, okay?
Speaker A
When I tell you that the employee number determines the employee's name and salary, when I mention, for example, any role or anything we have, anything—do you remember what you took in databases ? Normal forms, okay? In normal forms,
Speaker A
any dependency or functional dependency that occurs between two items, if I can link them, I can retrieve their data.
Speaker A
Used to deduce information not directly available to the user, we already discussed this point. So, what is an inference channel? An inference channel , simply put, An inference channel is simply the path through which information travels; " channel" means a path, okay? It will
Speaker A
transport information that is unauthorized for the user, okay? Consequently, they reach the results they want, which they are not allowed to access. We have unauthorized results. I have metadata; for example, each department has a department head. If I
Speaker A
retrieve the highest salary in the department, automatically, whose salary would this highest salary be? The department head's, why? Because each department has only one head. So, the inference channel allowed me to link via the metadata or the dependencies, and
Speaker A
thus, what happened? Sensitive data leak, sensitive data what ? Leak, okay. So, what inference techniques do we have ?
Speaker A
The inference techniques we have, he tells me, are two: functional dependencies and merging views with the same constraints.
Speaker A
Functional dependencies, which is the analysis of functional dependencies, how so? He says simply that I have attributes within a table, each group of attributes has an identifier, okay? If I can identify this identifier, I can know this data, and thus I can link them
Speaker A
together. He says the second type is merging views with the same constraints . If I have two views, the first view and the second view, and I tell you to select availability and cost from inventory where the department is what?
Speaker A
Hardware, so our constraint is who? That the department is named what? Hardware, uh, hardware, okay. In the second view, I tell you to get me the item and the department when our department type is what? Hardware. I now have knowledge
Speaker A
that there is a department, an item, availability, and cost in each department okay? If my data arrives in the same order as we see in these views, I can link each record with a record, and I was able to
Speaker A
know the availability, cost, item, and department for the single record, okay? Consequently, when I merge the results from two views that have the same constraints, what happens here too?
Speaker A
An inference occurs, okay. Approaches to preventing inference. What methods do we have to prevent inference?
Speaker A
To prevent inference, we must or have two methods: the first is detection during database design, and the second is detection at query time. Regarding detection during database design, during the database, any dependencies we have, any functional dependency, you separate
Speaker A
it into another table to prevent any inference channel from occurring. Therefore, before I deploy the database , before I store data in it, and before I build my applications on it, I must have partitioned the tables to prevent
Speaker A
any method of inference or linking between what? Between the tables, okay? So, I will change the database structure and change the access control based on the new database structure. This is the first method to prevent what? Inference.
Speaker A
The second method is detection at query time. So, the first method was where? Before I create the database, while I am designing the database, which is what?
Speaker A
The first method. The second method, it tells you that during execution or query time, I will detect inference violations during query execution. It considers every query or set of queries; I want to look at them and see if there is a way
Speaker A
to combine this data together or not. If I find a way to execute the query or set of queries and find that it opens an inference channel between them, I will reject the query coming from the user.
Speaker A
For example, let's assume User A asked me for the data of employees in the Administrative Affairs department, for instance, okay? Then User A came after that and said, "Give me a list of salaries for the Administrative Affairs department employees," and they are not
Speaker A
allowed to access what? Salaries. In this case, we have what? The possibility that what?
Speaker A
There is an inference process taking place, okay. Inference detection during database design; it tells you how we will prevent it? First, split the tables , removing data dependencies by splitting tables into multiple tables.
Speaker A
So, the first thing is I will split the tables okay? After that, I will apply finer-grained RBAC rules; it tells me regarding the Role-Based Access Control rules, what should I do with them? I want to split them into the smallest possible unit,
Speaker A
meaning I could reach the level of the value, okay? Well, does this solve what ? Inference during database design. So, what will happen for us? It tells me we will have two problems. The first problem is strict control; our control
Speaker A
will be what? Very difficult, okay? The control will be difficult, rigid, and stiff. Consequently, what will this technique do? It will create strict access control, and the second thing is lower availability.
Speaker A
As long as the data is highly restricted and heavily controlled, it means accessing the data or the speed of accessing the data, the speed of using the data for those authorized to reach it, will be what?
Speaker A
It will be difficult, and therefore we will have what? These two problems. So, as we always said from the beginning , in data security or computer security , we try to create a trade-off between security policies and what?
Speaker A
Which is the functionality of, of what? The system. So, availability is very important to me, and therefore I must keep the security level and protection level such that it gives me an acceptable level, but it should not be
Speaker A
too complex and ruin the availability, okay. Inference detection at query time; it tells me to identify inference channel violations while queries are being processed okay?
Speaker A
So the first thing is I have a query, I will do what? Submit, okay? I will start monitoring the query processing.
Speaker A
The user sends the first query; the system does not output the query alone, no, it takes it, takes a copy of it, then looks at the next query and the next, or the previous queries, and sees what the relationship of this query is
Speaker A
to the previous ones. As long as we are talking about query history, I see if there is a possibility to link them?
Speaker A
If there is a possibility to link them, it means there is a possibility to create what? An inference channel. As long as there is a possibility to create an inference channel, I simply prevent the data from returning to the user and
Speaker A
perform what is what? the user, so that I can revoke the permission that allows them to perform what? An inference channel.
Speaker A
So the key idea here is that we prevent people from deriving unauthorized data or information they are not permitted to access by way of what?
Speaker A
Combining a set of results they are permitted to access. So, what do we have ? What are the challenges in inference detection?
Speaker A
It tells me that whether we choose to perform inference detection during database design or during query execution, we need algorithms to detect this inference. And this is a difficult problem why?
Speaker A
Because the detection algorithm will require us to build complex algorithms to analyze the database environment, analyze the security issues we have, or the security rules we have, and what the relationship is between data elements, and consequently, we will have what?
Speaker A
In this case, we will have what? That is, high complexity, as we said, both require what? An inference detection algorithm. The inference detection algorithm is a difficult task that is still under research today, still what? Under research today,
Speaker A
because I need an algorithm that, first , understands the inference between databases, understands the relation between data.
Speaker A
Understand the relation between the data , then I will link these two things together.
Speaker A
So now we have Who? We have a database, okay, that contains whose data? Employees, it contains employee names, their addresses , and their salaries. Our writer can see the employee names alone, or the names and addresses of employees, or the
Speaker A
salaries of employees; they cannot see employee names with addresses with what ? Salaries together. This permission is denied to them. So who has this permission? It says this permission exists only with whom? With the administrator. Now I want to prevent
Speaker A
them from doing this; I want to prevent the writer from being able to link the employee name with the address and the salary. Now, if the data were stored in one table, one way or another, they would be able to know why? Because they
Speaker A
have the salaries, they can pull them with a query; the names, they can pull them with a query, right? I mean, if they say "show me the salaries as they are," it will show them as one column, just as the salaries are, so it pulls up
Speaker A
one column containing what? The salaries we have; here is the first, second, third, fourth, and fifth salary. And they said, "show me the employee names without ordering," just as they are, first second third fourth fifth.
Speaker A
They could link this column with this attribute, this attribute with this attribute, and be able to know that Ahmed's salary is, Ali's salary is, Hussein's salary is, and so on.
Speaker A
We want to prevent this; in database design, it tells us to separate the salary and put it in a separate table we named what? A salaries table with a salary ID and the value of what? The salary. Well, since we separated it into
Speaker A
a separate table, that means we need to link it with what? With the employee table, so we created a table called employee salary; we put the employee number and their salary number in it; in this case, no matter how hard the writer
Speaker A
tries to link, they will not be able to reach what? to the data that is complete and can get who? The employee's salary, okay.
Speaker A
Alright. General challenges of inference detection, what problems do we have with inference detection? Right? He says generally that inference detection in relational databases is complex and difficult, and while relationships between data elements do reveal information, in order to link them, I
Speaker A
must have what? External knowledge of the metadata, which is what? Related to the data, meaning I must have descriptive data and prior knowledge to support my inference.
Speaker A
Another thing he says is invisible channels right? He says some inference channels cannot be identified directly; no, I must have the data inside the database, right?
Speaker A
It won't just be table to table, I must also have the data within the database.
Speaker A
He says generally that there is currently progress in this area, in inference detection, but we haven't reached a satisfactory result yet; he says so far we don't have a general complete solution, we don't have an absolute detection method I can rely on
Speaker A
and say this technique can be applied to all databases to prevent what? Which is inference, right? Okay, in summary, we talked about inference, we talked about metadata and the relationships between data and dependencies, and we talked about inference channels, which is how I find
Speaker A
the link between two subsets of data and be able to connect them. We talked about the two techniques, which are either checking functional dependencies or merging what?
Speaker A
The database views. Then we talked about two prevention approaches, how do we prevent this? We talked about either doing it during database design or during execution at query time, right?
Speaker A
During design, I always try to remove functional dependencies and put them in separate tables; in the case of query time, every query I receive, I shouldn't treat it as a separate unit, I should compare it with the history of queries
Speaker A
the employee or user has previously made to see if they can link them or not.
Speaker A
The inference problem, as we said, is an open problem; it is still an active issue and there is ongoing research currently why?
Speaker A
Because it is a complex problem; building algorithms for inference detection is complex, and the results cannot be generalized to all the databases we have.
Speaker A
With that, we have finished section 5.6 ; in the next video, God willing, we will start section 5.7, where we will talk about database encryption. Thank you very much.
Topics:inference attackdatabase securityaccess controlRBACfunctional dependencymetadatainference channelviewsquery monitoringnormal forms











