Summary
Shiori's account update endpoint allows authenticated users to change the owner field without proper authorization checks.
By sending a crafted PATCH request that sets owner: true and then re-authenticating, an attacker can obtain an administrator JWT token and gain full system access under normal authenticated usage conditions.
Affected context
This vulnerability appears in Shiori's user account management API, specifically the endpoint responsible for updating account details.
It is relevant in deployments where:
- Users can update their own account attributes via PATCH or similar HTTP methods
- The
owneror equivalent administrative flag is stored as part of the account record - Authorization checks on sensitive role or ownership fields are missing or incomplete
Exploit preconditions
- Attack surface: Application's authenticated account update endpoint (HTTP PATCH)
- Required access: Valid user account with the ability to send authenticated API requests
- Trigger point: Submission of a crafted PATCH request that sets
owner: trueor equivalent administrative flag - Why exploitation is possible: The endpoint updates sensitive role/ownership fields without enforcing authorization or role-change policies, allowing any authenticated user to promote themselves to an owner/admin role and then obtain a corresponding JWT token.
Why this happens
The root cause is insufficient authorization enforcement when modifying privilege-bearing account fields.
The account update logic treats changes to the owner flag like any other mutable attribute, failing to apply stricter checks or role transition rules.
This maps to CWE-269: Improper Privilege Management, where the system does not correctly control the ability to gain higher privileges, allowing low-privilege users to become administrators purely through data manipulation.
Potential impact
- An attacker may escalate from a normal user to an administrator (owner) account.
- An attacker could gain full access to Shiori's management functions and protected data.
- Attackers can modify or delete bookmarks, configurations, and other users' data.
- Administrators may lose control over the instance due to unauthorized admin accounts.
General mitigation guidance
Effective mitigation centers on enforcing strict authorization around any changes to privilege-related fields.
Common defensive patterns include:
- Treating role, ownership, and administrative flags as immutable via self-service APIs, requiring separate, privileged workflows for role changes.
- Implementing server-side authorization checks that verify the caller's existing role before allowing any elevation or ownership transfer.
- Centralizing privilege management logic so that updates to security-sensitive attributes go through a single, audited policy enforcement layer.
- Applying least-privilege design so routine account updates can never directly modify administrative or owner attributes.
How teams detect issues like this
Detection often involves reviewing and monitoring how account attributes are updated and which fields are exposed via APIs.
High-level strategies include:
- Static analysis rules that flag APIs updating role/ownership fields without explicit authorization checks.
- Code review practices that treat privilege-bearing attributes (e.g.,
owner,is_admin,role) as security-sensitive and require documented access control logic. - Logging and auditing all changes to roles or ownership, with alerts when such changes originate from non-administrative accounts.
- Policy-based enforcement in CI/CD that requires security review for any modification to authentication or authorization-related code paths.

