Skip to content

20261104 Rote

vul.yulun.ac.cn • November 12, 2026

Rote lets users bind a GitHub or Apple account to an existing account. When the third-party account is already bound to another Rote account, the frontend offers to merge the two accounts and calls POST /v2/api/auth/oauth/:provider/bind/merge after the user confirms. existingUserId and providerUserId come entirely from the request body:

The checks that follow only confirm that these two parameters match a real binding in the database:

No step verifies that the caller owns that third-party account, so the attacker supplies its ID freely. Once the checks pass, the server merges the accounts:

mergeUserAccounts moves the notes, attachments, API keys, push subscriptions, and OAuth bindings of the source account to the caller, then deletes the source account:

Both IDs the attack needs are public. existingUserId comes from the public profile endpoint, and the GitHub numeric ID comes from .

Reproduction Environment

Deploy with the official docker-compose file:

Open and finish the setup wizard, creating the super admin rootadmin with password Admin12345. . Register two regular accounts, victim and attacker , both with password Passw0rd12345. . As victim , create one private note with the content VICTIM-PRIVATE-NOTE: bank account 6222-0000-1111-2222 :

As victim , bind the GitHub account victimgh . When the lab cannot reach the real GitHub, insert an equivalent binding record directly. 12345 is the GitHub numeric ID of victimgh :

Log in as attacker , take the Rote user id of victim from the public profile endpoint GET /v2/api/users/victim , and take the GitHub numeric ID from . Then run this script to start the merge:

The private note of victim now belongs to attacker :

The account of victim has been deleted, so the old password no longer logs in:

The login endpoint answers:

2. Privilege Escalation from admin to super_admin by Reading and Rewriting jwtSecret

Rote has four roles, user , moderator , admin , and super_admin , and operations such as changing a user’s role are reserved for super_admin . The configuration endpoints only require admin :

The response masks only the ai group and returns the rest as is:

The security group holds jwtSecret , jwtRefreshSecret , sessionSecret , the OAuth clientSecret , and other secrets, so a plain admin reads the signing key directly.

PUT /v2/api/admin/settings also requires only admin and applies no field whitelist to the security group, so the attacker can rewrite jwtSecret as well. The super admin check covers only the system group:

The access token is an HS256 JWT signed with jwtSecret :

The auth middleware verifies the signature and then loads the user named by the userId inside the token. With jwtSecret an attacker signs a valid token for any user, including the super admin.

Reproduction Environment

Deploy with the official docker-compose file:

Open and finish the setup wizard, creating the super admin rootadmin with password Admin12345. . Register a regular account sysadmin with password Passw0rd12345. . The user list in the admin panel offers no way to change roles, so grant sysadmin the admin role with:

Log in as sysadmin and open the admin panel:

The user list shows sysadmin with the role admin :

Run the following script. It reads jwtSecret , forges a token for rootadmin , and uses it on the role endpoint that only super_admin may call:

Reload the admin panel, and sysadmin now has the role super_admin :