review: security specialist checks authorization a route-guard read misses

Four access-control classes where the guard is correct and the object still
leaks: error pages composed outside the guard, ownership surviving a role
downgrade, list/detail/download paths checked as one, and a session mutated
before the identity-switch callback is validated.

Adopted to review/specialists/security.md only; the /cso hunk targeted a
bullet list that is now an OWASP/ASVS table.

Co-authored-by: EmilianoU26 <314541067+EmilianoU26@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
committed 2026-10-08 14:53:25 +00:00
1 parent 7d88f13f58
commit 574a0c8dbb
2 files changed
+14

No files matched your search

+4
View File
@@ -26,6 +26,10 @@ This checklist goes deeper than the main CRITICAL pass. The main agent already c
- Direct object reference vulnerabilities (user A accesses user B's data by changing an ID)
- Session fixation or session hijacking opportunities
- Token/API key validation that doesn't check expiration
- Error pages that leak past a correct guard: the shared 403/404/500 renderer builds its body outside the authorization path, so a blocked request still returns internal names, counts or navigation the role must not see. Read the error template and its context builder, not just the guard
- Ownership that survives a role downgrade: a grant recorded at creation still opens the object after the user's role is reduced and they sign in again. Ownership must be re-checked against the current role on every read
- List, detail and file/download access to one object audited as a single entry: each usually resolves the object through a different code path, so check each against the role matrix separately
- Account or identity switch that clears, regenerates or rebinds the session before validating the callback's single-use state value: any forced navigation to that URL logs the user out (CSRF). Also check the denied, cancelled and error branches, where leaving the prior session live keeps the user acting as the previous identity
### Injection Vectors (beyond SQL)
- Command injection via subprocess calls with user-controlled arguments
+10
View File
@@ -477,3 +477,13 @@ test('testing specialist treats negative assertions as decisions and catches one
['grep', 'negative assertions', 'old value'],
], 'testing specialist');
});
test('security specialist checks authorization paths a route-guard read misses', () => {
const auth = compact(between(readFileSync(join(root, 'review/specialists/security.md'), 'utf8'), '### Auth & Authorization Bypass', '\n### '));
expectMentions(auth, [
['error', 'renderer', 'outside', 'guard'],
['ownership', 'role', 'downgrade'],
['list', 'detail', 'download', 'separately'],
['session', 'before', 'validating', 'callback'],
], 'security specialist');
});