Privilege Escalation via Account Takeover on NodeBB Forum Software — Bug Bounty (512$)
The password change endpoint trusted a user-supplied uid, so any logged-in user could change another account's password by swapping the uid in the request. An attacker could take over the admin account and gain full control of the forum.
Published on medium.com
{{media:0}}
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
NodeBB is forum software, and the target in this write-up is the public demo instance at try.nodebb.org. The feature involved is the ordinary password change flow that every logged-in user reaches from their own profile: you supply your current password, then the new password twice, and submit. That flow is supposed to act only on the account of the user who is authenticated.
The researcher found that the same flow could be pointed at any other account, including the administrator's, by changing a single identifier in the request. The result is a full account takeover of the admin user, which in a forum means privilege escalation. The researcher received a 512 USD bounty.

Setup
- Target: NodeBB forum software, tested on the public demo at
try.nodebb.org. - Accounts: the built-in
adminaccount (not owned by the researcher) and a self-registered account namedtestuser1. - Tooling: a browser for the normal flow and Burp Suite as an intercepting proxy to modify the password change request before it was submitted.
- Precondition: the attacker needs a valid account of their own on the forum, so that they can reach the password change page. No other access is described.
Finding it
While testing NodeBB, the researcher found that the password of every user account could be changed. The reasoning started from the user profile URL scheme. NodeBB exposes profiles under a numeric user id (uid), and the researcher probed that id to identify the administrator:
https://try.nodebb.org/uid/*
Trying numbers in place of the asterisk showed that the admin account has uid 1, and that the id resolves to the admin's profile:
https://try.nodebb.org/uid/1 -> https://try.nodebb.org/user/admin

That gave a predictable identifier for the highest-privileged account. The next question was whether any request that carries a uid would honour a value the client supplies.
Exploitation
Step 1: identify the admin uid
Enumerate the numeric uid in the profile URL until the admin profile appears. uid 1 belongs to admin, as shown above. This is the value that will be substituted later.
Step 2: create an attacker account
The researcher registered a normal user named testuser1. This account is only needed to authenticate and reach the password change page; it is not the victim.

Step 3: open the password change page
From the testuser1 profile, go to the password change page. Enter the current password of testuser1 in the first box, and the desired new password in the second and third boxes.

Step 4: intercept and rewrite the uid
Before pressing submit, turn on Burp Suite's proxy, capture the password change request, and replace the uid value in it with 1, the admin's uid. Then forward the request. The report does not reproduce the raw request, so the exact parameter names and body are not given here.
Step 5: log in as admin
With the request accepted, the password that was typed into the form in step 3 is now the password of the admin account. Enter admin in the username box and that password in the password box.
Step 6: confirm the takeover
The login succeeds and the researcher is in control of the admin account.

Root cause
The password change handler trusts a client-supplied uid to decide which account's password to set, instead of deriving the account from the authenticated session. Because the value is taken from the request, any authenticated user can name any other user, including the administrator. The report does not include the server-side code, so the precise implementation is not shown; the behaviour is consistent with a missing authorisation check that the uid in the request matches the session user.
Impact
An attacker with any ordinary account on a NodeBB forum can change the password of any other account whose uid they can guess or enumerate, and then log in as that user. Targeting uid 1 gives administrator access, so the practical impact is full privilege escalation on the forum. The report describes the effect on every user account, and the bounty was 512 USD.

Fix
The report links to the NodeBB security advisory GHSA-hr66-c8pg-5mg7 on GitHub, which it says contains information that the vulnerability was closed. The report does not describe the code change itself. The correct behaviour is for the password change handler to ignore any client-supplied uid and operate only on the account identified by the authenticated session, rejecting requests that try to name a different user.
Variants to test
- Other account-mutating endpoints with a uid parameter. Try email change, username change, avatar or profile updates, and account deletion, substituting another user's
uid. A positive result is the change being applied to the victim account rather than your own. - uid in different locations. Move the identifier between the query string, the body and hidden form fields, and try JSON bodies where forms are used. A positive result is any placement where the server honours the supplied value.
- Identifier formats. Try the numeric id, the slug (
admin), and any internal id exposed elsewhere in the application. A positive result is a request that resolves to the victim account. - Password reset and email verification flows. Check whether the token or user reference in those flows can be swapped for another user's. A positive result is a reset or verification completing against an account you do not own.
- Enumeration of privileged accounts. Walk the numeric id space and note which ids map to staff or admin profiles, as was done here with
uid1. A positive result is a reliable map of high-value accounts to target with the above tests.
What happened, in plain words
NodeBB is software for running an online forum, a discussion site where people register accounts, post messages and reply to each other. The researcher tested the public demo of NodeBB at try.nodebb.org, a copy of the software that anyone can use to try it out.
Every forum account has a password. Normally you can only change your own password, and to do that the site asks you for your current password first, then asks you to type the new one twice. That is a safety measure: it proves you are the person sitting at the keyboard and that you have not simply walked up to an unlocked browser.
The researcher found that this password change form could be made to change somebody else's password, including the password of the forum administrator, the account with the most power on the site. The trick was to change one number in the request that the browser sends to the server. The result is called an account takeover: the attacker ends up in control of an account that is not theirs. Because the account taken over was the administrator's, the result is also called privilege escalation: the attacker gains a higher level of power than they started with.
A CVE is a public catalogue number for a known security flaw, so that people can talk about the same bug unambiguously. The researcher received a bounty of 512 US dollars. A bug bounty is a programme where a company pays people for reporting security problems instead of punishing them.

The pieces you need to know first
Before the steps make sense, a few everyday ideas.
Server and browser. Your browser is the program on your computer that shows web pages. The server is the computer somewhere else that stores the forum and answers your browser's requests. Every time you click something, your browser sends a message to the server and the server sends back a page.
Request. That message from browser to server is a request. It contains the address of the page you want, plus extra data, for example the contents of a form you filled in. When you press a submit button, the browser packages up what you typed and sends it.
API. An API is a way for one piece of software to talk to another, a fixed set of addresses and rules for asking questions and getting answers. You can think of it as a restaurant menu: you do not walk into the kitchen, you order from the list and the kitchen sends back a dish. Many web pages are really thin front ends over an API: the page you see sends requests to the server behind the scenes.
Session and cookie. A website needs to remember who you are between one click and the next. After you log in, the server gives your browser a small piece of data called a session cookie. Your browser sends it back with every request, like a wristband at an event that proves you paid to get in. The server looks at the wristband and knows which account the request belongs to. A token is a similar idea: a string of characters that stands in for your identity or your permission.
Identifier. Many systems give every user a number, called an id. NodeBB calls it the uid, short for user id. The first account created on a fresh forum usually gets the smallest number, so the administrator often ends up as uid 1. This is not a secret; it is just a label.
IDOR. The vulnerability class here is IDOR, short for Insecure Direct Object Reference. The name sounds complicated but the idea is simple. Imagine a hotel where the receptionist hands you a key with your room number on it, and the door lock only checks that the key says "room 12", not that the key belongs to you. If you scratch out 12 and write 13, you get into someone else's room. In software, an IDOR happens when the server accepts an identifier supplied by the client, the browser, and uses it to decide which record to act on, without checking that the client is allowed to touch that record. The client here means anything the user's browser sends, and the user can change all of it.
Account takeover. When an attacker gains control of another person's account, usually by changing its password or stealing its session, that is an account takeover. If the victim account has more power than the attacker's own, the takeover also escalates privilege.
Intercepting proxy. A proxy is a program that sits between your browser and the server and passes messages back and forth. An intercepting proxy lets you pause a message on its way out, read it, edit it, and then let it continue. Burp Suite is a well-known tool for this. It is how you change a request after the browser has built it but before the server sees it. You do not need to be a programmer to use it for this: you turn it on, fill in the form, and edit the text before forwarding.
Setting up
The researcher used:
- The target: NodeBB forum software, tested on the public demo at
try.nodebb.org. - Two accounts: the built-in
adminaccount, which the researcher did not own, and a normal account the researcher registered, namedtestuser1. - A browser for the ordinary flow, and Burp Suite as an intercepting proxy to change the password change request before it was sent.
- One precondition: the attacker needs a valid account of their own on the forum, so that they can reach the password change page at all. Nothing else is described as necessary.
Finding it
While testing NodeBB, the researcher found that the password of every user account could be changed. The reasoning started from the way profile pages are addressed. NodeBB shows a user's profile at an address built from their numeric user id, the uid. The researcher probed that number to find the administrator:
https://try.nodebb.org/uid/*
This is a URL, a web address. The part after the site name, /uid/*, is the path. The asterisk is a placeholder: it stands for "put a number here". By trying numbers in place of the asterisk, the researcher found that the admin account has uid 1, and that this id leads to the admin's profile:
https://try.nodebb.org/uid/1 -> https://try.nodebb.org/user/admin
The arrow means "leads to": asking for /uid/1 shows you the profile of the user called admin. In plain words, the highest-powered account on the forum has the most predictable possible number, 1. That gave the researcher a reliable label for the account worth attacking. The next question was whether any request that carries a uid would accept a value the browser supplies, rather than deciding the account from the logged-in session.

Exploitation, step by step
Step 1: find the admin's uid
The researcher walked through the numbers in the profile address until the admin profile appeared. uid 1 belongs to admin, as shown above. This is the value that will be swapped in later. Why do this first? Because to point the password change at the admin, you need to know what number the server uses for the admin.
Step 2: create your own account
The researcher registered a normal user named testuser1. This account is only needed to log in and reach the password change page. It is not the victim; it is the attacker's own foothold. Why is it needed? Because the password change page is only shown to logged-in users, and the request has to carry a valid session so that the server accepts it at all.

Step 3: open the password change page
From the testuser1 profile, go to the password change page. Enter the current password of testuser1 in the first box, and the desired new password in the second and third boxes. This is the normal, honest use of the form: you prove you know your own current password, and you choose a new one. Nothing suspicious happens yet.

Step 4: intercept the request and rewrite the uid
Before pressing submit, turn on Burp Suite's proxy, capture the password change request, and replace the uid value in it with 1, the admin's uid. Then forward the request. Forwarding means letting the edited message continue on to the server.
Why does this work? The form was filled in as testuser1, but the request also carries a uid saying which account to change. The browser sends whatever the page put there, and the proxy lets you change it. If the server trusts that number instead of looking up the account from your session, it will change the password of whichever account the number names. The report does not reproduce the raw request, so the exact parameter names and body are not given here.
Step 5: log in as admin
With the request accepted, the password typed into the form in step 3 is now the password of the admin account. Enter admin in the username box and that password in the password box. In other words, the new password you chose for yourself has become the admin's password.
Step 6: confirm the takeover
The login succeeds and the researcher is in control of the admin account. That is the whole attack: no special software beyond a proxy, no guessing of the admin's password, just one number changed in a request that was otherwise completely normal.

Why it worked
The password change handler, the part of the server that processes the form, trusts a uid supplied by the client to decide which account's password to set. It should instead work out the account from the authenticated session, the wristband described earlier, and ignore any number the browser sends. Because the value is taken from the request, any logged-in user can name any other user, including the administrator. The report does not include the server-side code, so the precise implementation is not shown. The behaviour is consistent with a missing authorisation check: the server never verifies that the uid in the request matches the user in the session.
Impact
An attacker with any ordinary account on a NodeBB forum can change the password of any other account whose uid they can guess or enumerate, and then log in as that user. Enumerating means trying the numbers one by one, which is easy when they are small and sequential. Targeting uid 1 gives administrator access, so the practical impact is full privilege escalation on the forum. The report describes the effect on every user account, and the bounty was 512 USD.

The fix
The report links to the NodeBB security advisory GHSA-hr66-c8pg-5mg7 on GitHub, which it says contains information that the vulnerability was closed. The report does not describe the code change itself. The correct behaviour is for the password change handler to ignore any client-supplied uid and operate only on the account identified by the authenticated session, rejecting requests that try to name a different user. In hotel terms: the door should open only for the key that belongs to you, no matter what number is written on it.
Variants to test
Once you understand the pattern, you can look for it elsewhere. Each item below is a way to check whether the same mistake exists in another feature. A positive result means the change was applied to the victim account rather than your own.
- Other account-mutating endpoints with a uid parameter. Try email change, username change, avatar or profile updates, and account deletion, substituting another user's
uid. An endpoint is simply a specific address on the server that does one job. - uid in different locations. Move the identifier between the query string (the part of a URL after a question mark), the body of the request, and hidden form fields, and try JSON bodies where forms are used. JSON is a common text format for structured data. A positive result is any placement where the server honours the supplied value.
- Identifier formats. Try the numeric id, the slug (
admin), and any internal id exposed elsewhere in the application. A slug is the human-readable name used in a URL. - Password reset and email verification flows. Check whether the token or user reference in those flows can be swapped for another user's. A positive result is a reset or verification completing against an account you do not own.
- Enumeration of privileged accounts. Walk the numeric id space and note which ids map to staff or admin profiles, as was done here with
uid1. A positive result is a reliable map of high-value accounts to target with the above tests.
Glossary
- Account takeover: gaining control of another person's account, usually by changing its password or stealing its session.
- API: a fixed set of addresses and rules that lets one piece of software ask another for data or actions.
- Authorisation check: a check on the server that the logged-in user is allowed to perform the requested action on the requested record.
- Bounty: a payment a company makes to someone who reports a security problem to it.
- Browser: the program on your computer that displays web pages and sends requests to servers.
- Burp Suite: a tool that sits between your browser and a server so you can pause, read and edit requests.
- Client: the user's side, normally the browser; anything the client sends can be changed by the user.
- Cookie: a small piece of data a site stores in your browser and your browser sends back with each request, often used to identify your session.
- CVE: a public catalogue number for a known security vulnerability.
- Endpoint: a specific address on a server that performs one job.
- Enumeration: trying values one by one, for example numbers in a URL, to discover which ones exist.
- IDOR (Insecure Direct Object Reference): a flaw where the server accepts an identifier from the client and acts on the record it names without checking that the client is allowed to.
- Intercepting proxy: a proxy that lets you pause and edit messages between browser and server.
- JSON: a common text format for structured data, used in request and response bodies.
- NodeBB: software for running an online discussion forum.
- Password change handler: the part of the server that processes the password change form.
- Privilege escalation: gaining a higher level of access or power than you started with.
- Proxy: a program that passes messages between your browser and a server, optionally letting you inspect them.
- Query string: the part of a URL after a question mark, carrying extra values.
- Request: the message a browser sends to a server asking for a page or an action.
- Server: the remote computer that stores the site and answers requests.
- Session: the server's memory of who you are across multiple requests, usually tied to a cookie.
- Slug: the human-readable name used in a URL, such as
admin. - Token: a string of characters that stands in for your identity or permission.
- uid: user id, the number a system uses to identify an account.
- URL: a web address.
- Vulnerability: a weakness in software that someone can abuse to do something the designers did not intend.