Skip to content

bug(security): a delegate-minted session can self-approve gated skills with the audit blind to it (is_person fails open) #3404

Closed

Description

@vybe

Deferred-debt entry (verbatim from the trinity-dev DEBT_INBOX.md)

debt:2026-10-03-gate-delegate-session-self-approval-audit

What: A Workspace session minted through a portal_delegate key (portal_exchange) is indistinguishable from a person's own OTP session, so it counts as a proven person and can self-approve a gated skill for that email. The self-approval audit row from the execute_task backstop records no credential kind (current_user=None), so a browser session, a user-scoped key and a delegate-minted session look alike. Separately, PortalPrincipal.is_person defaults to True, a fail-open default now that the field decides self-approval.
Why deferred: The reach matches ent#611's answer route (a delegate-minted session can already answer asks as that person). Telling the two apart needs a claim in the portal session token, which is a separate design change.
Context: client_portal/portal_auth.py::get_portal_principal (the session branch returns PortalPrincipal(email, False)), client_portal portal_exchange, skill_gate_service.audit_self_approved. Options: stamp minted_by=delegate in the session token and treat such sessions as unproven for self-approval, and record the credential kind on the audit row. Also flip the is_person default to False, with every constructor passing it explicitly.
Interest: An integration holding a delegate key can run a gated skill for any approver whose email it can mint a session for, and the audit trail cannot show that it did.
Effort (AI): M
Source: abilityai/trinity-enterprise#751 (delta review after the eyeball)


Filed by trinity-pm /groom 2026-10-08 (Debt Health & Inbox Triage).

Activity

  1. added
    priority-p1
    type-bug
    theme-security
    complexity-medium
    status-ready
    on Oct 8, 2026
  2. added
    status-in-progress
    and removed
    status-ready
    on Oct 9, 2026
  3. added
    status-in-dev
    and removed
    status-in-progress
    on Oct 10, 2026
  4. removed
    status-in-dev
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

complexity-mediumpriority-p1theme-securitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions