Invental/Review lessons/Trust boundaries the server must hold

Trust boundaries the server must hold

Existence checks can leak restricted data

“Does any secret have this value?” is itself a read of secret data. Gate it at least as tightly as reading the value, or it becomes a guessing oracle across permission boundaries.

01 · Before and afterThe pattern

TypeScript
// before: coarse project check, then return every match
await assertCan(actor, "ListSecrets", project);
return findSecretsWithValue(digest(value));

// after: an explicit, org-level grant for the cross-boundary capability
await assertOrgCan(actor, "SearchValuesAcrossProjects");   // 403 otherwise
return findSecretsWithValue(digest(value));

02 · Run it on your appThe check

Do any of your “exists / duplicate / match” endpoints tell users about records they are not allowed to read?

If the honest answer is no or not sure, this is worth a look before it reaches production.

Want this checked on your code?

Tell us what you are building and what worries you. We match a senior reviewer to your code and confirm scope before anything starts.

— Get in touch
hi@invental.co ↗
— Or
— What to include

A link or short description of the code or system, what you want checked, your stack, and when you need the answer. No repository access is needed until scope is agreed.

— Or leave a note
We reply within one business day.