You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(security): exempt engine referential FK clears from the owner_id transfer guard (#3023) (#3048)
owner_id is a lookup to sys_user with default deleteBehavior 'set_null', so deleting
a sys_user makes cascadeDeleteRelations null owner_id on every dependent. That
cascade write re-entered the write middleware under the deleter's context, where the
#3004 ownership-anchor guard read owner_id=null as a user disown and denied it —
aborting the cascade mid-way (no transaction → partial state) for any deleter lacking
the transfer grant on the child.
The cascade FK clear is engine-mandated referential integrity, not a user ownership
change. cascadeDeleteRelations now tags the set_null write with a server-derived
__referentialFieldClear context marker (set by the engine, never built from a request
— same trust model as __expandRead), and the ownership-anchor guard skips when it is
present. The marker can't be forged from client input, so it can never slip a real
ownership transfer past the guard.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments