How a Forged Token Exposed an Entire B2B Trade Catalog
The GraphQL adapter that generated search tokens accepted identity and business-unit values directly from the request without verifying them against an authenticated session. An attacker could obtain a production-valid search credential without an account and query the search index, exposing product catalogs, wholesale prices, stock information, and customer-authorization lists.
medium.com
Published on medium.com
Bug Bounty
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 large B2B e-commerce platform where distributors and retailers could access product catalogs, negotiated prices and purchasing permissions. The researcher, Ifeoluwa (@ife0x01 on X), started by looking at the platform's search functionality, mainly to understand how it handled access control.
Search was handled by a GraphQL adapter connected to a third-party search service. One mutation on that adapter, coveoToken, was responsible for generating search tokens for users. The report does not name the platform, the search vendor's deployment or any endpoint paths, and the researcher states that for legal reasons the technical details and the identity of the target are withheld.
Setup
No accounts, roles, tools or versions are described. The only precondition the report establishes is that the guest authentication endpoint could be reached without credentials, which is what made the rest of the investigation possible. The researcher worked from observed network traffic while using the platform's search functionality.
Finding it
While going through the network traffic, the researcher noticed that searches were being handled by a GraphQL adapter connected to a third-party search service. The coveoToken mutation stood out because it generated search tokens for users.
The first question was what would happen if a token were requested without being logged in. The guest authentication endpoint returned an anonymous bearer token without requiring any credentials. On its own that was not necessarily a vulnerability, but it gave the researcher a credential to work with.
Looking into the token-generation mutation, several parameters controlled what ended up inside the JWT, including the username, the B2B unit ID, and whether certain product restrictions were enabled. The values appeared to come directly from the request rather than being verified against an authenticated user session. That was the assumption the researcher decided to test.
Exploitation
Step 1: obtain an anonymous bearer token
The researcher called the guest authentication endpoint with no credentials. It returned an anonymous bearer token. The report does not reproduce the request or the response.
Step 2: request a search token with fabricated identity values
Using the anonymous token, the researcher supplied a made-up email address, a fabricated B2B unit ID, and set both product-restriction flags to false. The request went through, and the adapter returned a signed JWT. The report does not reproduce the mutation or its variables.
Step 3: inspect the issued JWT
Decoding the token showed that the supplied identity and business-unit ID had been accepted. More importantly, the token carried the production search organization's authorization context. The researcher had obtained a production-valid search credential without having an account.
Step 4: query the search index
With the token in hand, the researcher queried the underlying search API directly. The first response returned 2,629 documents across 18 regional catalogs.
Further exploration produced more detail:
| Finding | Count |
|---|---|
| Documents in the first response | 2,629 |
| Regional catalogs | 18 |
| Products containing list prices | 1,882 |
| Products containing customer-authorization lists | 1,092 |
| Largest authorization list on a single product | 5,008 customer account IDs |
The records were not limited to product names and descriptions. They included wholesale prices, stock information, product identifiers, and lists showing which business accounts were authorised to purchase specific products.
Step 5: use the token against the adapter's suggestion functionality
The researcher also tried the generated token against the adapter's own suggestion functionality. It returned HTTP 200, showing that the adapter was also accepting the credential it had issued.
Root cause
The adapter trusted identity and authorization values supplied by the requester instead of verifying them against an authenticated session. The username, B2B unit ID and product-restriction flags were taken from the request and written into the signed JWT, so the anonymous guest token was enough to mint a search credential describing a fabricated identity and business unit.
Because the issued token carried the production search organization's authorization context, the search backend treated it as legitimate and returned documents from the index. The report does not describe any additional defence that was in place or why it failed; the boundary that should have tied token contents to a session simply was not doing its job.
Impact
An unauthenticated attacker could generate their own search credentials and access a significant amount of commercially sensitive information without a legitimate B2B account. The exposed data included wholesale prices, stock information, product identifiers, and per-product lists of the customer account IDs authorised to purchase them.
Fix
Based on the described root cause, the fix would be to derive the username, B2B unit ID and product-restriction flags from the authenticated session on the server side, and to reject any request that supplies them, rather than signing whatever values arrive in the mutation. The guest endpoint should not be able to obtain a token carrying the production search organization's authorization context.
Variants to test
- Guest token issuance. Request a token from the guest authentication endpoint with no credentials. A positive result is a usable bearer token; follow it into any mutation that mints downstream credentials.
- Identity fields in token-minting mutations. Look for mutations that accept a username, tenant ID, unit ID or similar identity field alongside a token request. A positive result is a signed token whose decoded claims match the values you supplied rather than your session.
- Boolean restriction flags. Set flags such as product-restriction or visibility toggles to false in the request. A positive result is a token whose claims reflect the override, or a response that returns data the flag should have hidden.
- Scope of the issued credential. Take the minted token to the underlying search or data API and query the index. A positive result is a document count and field set larger than your own account should see, especially price and authorization-list fields.
- Adapter's own secondary endpoints. Replay the token against suggestion, autocomplete or other adapter features. A positive result is HTTP 200 where the credential should not be accepted.
What happened, in plain words
A security researcher found that a large business-to-business (B2B) online shop let anyone create a special pass that unlocked its entire product search system. The shop is used by distributors and retailers to look up products, see special prices, and check who is allowed to buy what. The researcher did not need an account. By sending a few made-up details to one part of the website, they got a valid pass that let them read the shop's search index directly. That index contained wholesale prices, stock levels, product codes, and lists of which business customers were allowed to buy each product. In total, the first peek showed 2,629 documents across 18 regional catalogs, and some products had authorization lists with thousands of customer account IDs. The report does not state a severity rating. The report does not name the company or give a bounty amount.
Background: what the platform does
The target is a B2B e-commerce platform. Unlike a normal consumer shop, it is built for businesses: distributors and retailers log in to see product catalogs, negotiated prices, and purchasing permissions. "Negotiated prices" means the price a particular business has agreed with the seller, which can be different from the public price. "Purchasing permissions" means rules about which business accounts are allowed to buy which products. The researcher started by looking at the platform's search functionality, mainly to understand how it handled access control. Access control is the set of rules that decides who can see or do what. The researcher wanted to see whether the search respected those rules.
How the search worked
While going through the network traffic, the researcher noticed that searches were being handled by a GraphQL adapter connected to a third-party search service. Let's unpack that.
- Network traffic is the conversation between your browser and the website's servers. You can see it using the developer tools built into every browser (usually opened with F12). It shows the requests your browser sends and the responses it gets back.
- An API (Application Programming Interface) is a way for one piece of software to talk to another. Think of it as a waiter in a restaurant: you tell the waiter what you want, the waiter takes your order to the kitchen, and brings back your food. You don't go into the kitchen yourself. In the same way, your browser sends a request to an API, and the API talks to the servers and sends back data.
- GraphQL is a style of API where the client sends a query describing exactly what data it wants, and the server returns just that. It is different from older styles where the server decides what to send. A mutation in GraphQL is a request that changes something or creates something, as opposed to a query which only reads. Here, one mutation was responsible for generating search tokens for users.
- A third-party search service is an outside company that provides search technology. The platform sends data to this service and asks it to handle searches. The report mentions a mutation called
coveoTokenbut does not name the search vendor. The mutationcoveoTokenwas responsible for generating search tokens for users.
What is a token?
A token is a small piece of data that proves who you are or what you are allowed to do, a bit like a wristband at a festival. When you enter, you show your ticket and get a wristband. After that, you just show the wristband to get into different areas. You don't need to show your ticket again. In computer systems, a token is often a long string of characters that the server gives you after you log in. You then include that token in every request to prove you are still you.
A bearer token is a type of token where whoever holds it (the bearer) is treated as the owner. It's like a coat check ticket: whoever has the ticket can pick up the coat. If someone steals the ticket, they can get the coat. So bearer tokens must be kept secret.
A JWT (JSON Web Token) is a special kind of token that contains information (called claims) and is digitally signed. The signature lets the server check that the token was issued by a trusted party and hasn't been tampered with. You can decode a JWT to read the claims, but you can't change them without breaking the signature. Think of it like a sealed envelope with a stamp: anyone can open it and read the letter, but if you change the letter, the stamp won't match.
Finding the weakness
The researcher noticed the coveoToken mutation and wondered what would happen if they tried to get a token without being logged in. So they started with the guest authentication endpoint. An endpoint is a specific URL or address on a server where a particular function is available. The guest authentication endpoint is the part of the system that gives tokens to guests, i.e. people who are not logged in. It returned an anonymous bearer token without requiring any credentials. That wasn't necessarily a vulnerability on its own, but it gave the researcher a credential to work with.
Next, the researcher looked into the token-generation mutation. They saw that several parameters controlled what ended up inside the JWT. Parameters are the inputs you provide in a request, like the fields in a form. These parameters included the username, the B2B unit ID, and whether certain product restrictions were enabled. A B2B unit ID is an identifier for a business unit, such as a particular department or subsidiary of a company. Product restrictions are rules that limit which products a user can see or buy. The researcher noticed that these values appeared to come directly from the request rather than being verified against an authenticated user session. In other words, the server was trusting whatever the client sent, instead of checking it against who was actually logged in. That was the assumption the researcher decided to test.
Exploitation step by step
Step 1: obtain an anonymous bearer token
The researcher called the guest authentication endpoint with no credentials. It returned an anonymous bearer token. The report does not reproduce the request or the response, so we don't have the exact code here. But the idea is simple: the researcher asked the system for a token as a guest, and the system gave one without asking for a username or password. This is like walking into a hotel and asking for a room key without checking in; the hotel shouldn't give you one, but if it does, you can try to use it.
Step 2: request a search token with fabricated identity values
Using the anonymous token, the researcher supplied a made-up email address, a fabricated B2B unit ID, and set both product-restriction flags to false. The request went through, and the adapter returned a signed JWT. The report does not reproduce the mutation or its variables, so we don't have the exact code. But here's what happened in plain terms: the researcher sent a request to the coveoToken mutation, including the anonymous token to authenticate, and in the request body they put fake details: a fake email, a fake business unit ID, and they turned off the product restrictions by setting flags to false. The server accepted these details and gave back a JWT that was signed as if it were legitimate. This is like filling out a form with a fake name and address, and the system issuing you an official ID card with those fake details.
Step 3: inspect the issued JWT
Decoding the token showed that the supplied identity and business-unit ID had been accepted. More importantly, the token carried the production search organization's authorization context. The production search organization's authorization context means the token was issued with the permissions of the real, live search system used by the company, not a test or limited environment. So the token was accepted by the production search system. The researcher had obtained a production-valid search credential without having an account. This is like getting a key card that says "Staff" even though you're not staff, and it opens the staff-only areas.
Step 4: query the search index
With the token in hand, the researcher queried the underlying search API directly. The search index is the database that the search service uses to find and return results. By querying it directly, the researcher bypassed the normal website interface and asked the search service itself for data. The first response returned 2,629 documents across 18 regional catalogs. A document here means a record in the search index, likely representing a product. A regional catalogue is a collection of products specific to a region. So the first response returned 2,629 documents across 18 different regional catalogs.
Further exploration produced more detail:
| Finding | Count |
|---|---|
| Documents in the first response | 2,629 |
| Regional catalogs | 18 |
| Products containing list prices | 1,882 |
| Products containing customer-authorization lists | 1,092 |
| Largest authorization list on a single product | 5,008 customer account IDs |
The records were not limited to product names and descriptions. They included wholesale prices, stock information, product identifiers, and lists showing which business accounts were authorised to purchase specific products. Wholesale prices are the prices offered to businesses, often lower than retail. Stock information tells how many items are available. Product identifiers are codes like SKUs that uniquely identify products. Customer-authorization lists are lists of business accounts that are allowed to buy a particular product. The report describes this as commercially sensitive information.
Step 5: use the token against the adapter's suggestion functionality
The researcher also tried the generated token against the adapter's own suggestion functionality. Suggestion functionality is the feature that offers autocomplete suggestions as you type in a search box. It returned HTTP 200, showing that the adapter was also accepting the credential it had issued. HTTP 200 is the standard response code for "OK" or success. So the adapter accepted the token for another feature, confirming that the token was valid across the adapter.
Root cause
The adapter trusted identity and authorization values supplied by the requester instead of verifying them against an authenticated session. The username, B2B unit ID and product-restriction flags were taken from the request and written into the signed JWT, so the anonymous guest token was enough to mint a search credential describing a fabricated identity and business unit. Mint here means to create or issue a token. Because the issued token carried the production search organization's authorization context, the search backend treated it as legitimate and returned documents from the index.
Impact
An unauthenticated attacker could generate their own search credentials and access a significant amount of commercially sensitive information without a legitimate B2B account. The exposed data included wholesale prices, stock information, product identifiers, and per-product lists of the customer account IDs authorised to purchase them. The researcher classifies the issue as high severity.
Fix
Based on the described root cause, the fix would be to derive the username, B2B unit ID and product-restriction flags from the authenticated session on the server side, and to reject any request that supplies them, rather than signing whatever values arrive in the mutation. The guest endpoint should not be able to obtain a token carrying the production search organization's authorization context.
Variants to test
If you want to look for similar issues, here are some tests you can try. These are general ideas, not specific to this target.
- Guest token issuance. Request a token from the guest authentication endpoint with no credentials. A positive result is a usable bearer token; follow it into any mutation that mints downstream credentials.
- Identity fields in token-minting mutations. Look for mutations that accept a username, tenant ID, unit ID or similar identity field alongside a token request. A positive result is a signed token whose decoded claims match the values you supplied rather than your session.
- Boolean restriction flags. Set flags such as product-restriction or visibility toggles to false in the request. A positive result is a token whose claims reflect the override, or a response that returns data the flag should have hidden.
- Scope of the issued credential. Take the minted token to the underlying search or data API and query the index. A positive result is a document count and field set larger than your own account should see, especially price and authorization-list fields.
- Adapter's own secondary endpoints. Replay the token against suggestion, autocomplete or other adapter features. A positive result is HTTP 200 where the credential should not be accepted.
Glossary
- API: Application Programming Interface; a way for software to talk to other software, like a waiter taking your order to the kitchen.
- Access control: the rules that decide who can see or do what.
- Anonymous bearer token: a token given to someone not logged in, where possession alone grants access.
- Bearer token: a token where whoever holds it is treated as the owner; like a coat check ticket.
- B2B: business-to-business; selling between companies rather than to consumers.
- B2B unit ID: an identifier for a business unit, such as a department or subsidiary.
- Boolean: a value that is either true or false.
- Claims: the pieces of information inside a JWT, such as username or permissions.
- CoveoToken: the name of the mutation that generated search tokens.
- Credential: something that proves identity, like a password or token.
- CVSS: a standard scoring system for the severity of security vulnerabilities.
- Document: a record in a search index, often representing a product.
- Endpoint: a specific URL or address where a particular function is available.
- GraphQL: a query language for APIs that lets clients request exactly the data they need.
- Guest authentication endpoint: the part of the system that gives tokens to users who are not logged in.
- HTTP 200: the standard response code meaning "OK" or success.
- JWT: JSON Web Token; a signed token containing claims that can be verified.
- Mint: to create or issue a token.
- Mutation: in GraphQL, a request that changes or creates something.
- Network traffic: the requests and responses between your browser and a server.
- Parameter: an input value in a request, like a form field.
- Production: the live, real system used by actual users, as opposed to a test environment.
- Product restrictions: rules that limit which products a user can see or buy.
- Regional catalogue: a collection of products specific to a region.
- Search index: the database that a search service uses to find and return results.
- Suggestion functionality: the feature that offers autocomplete suggestions as you type.
- Third-party search service: an outside company that provides search technology.
- Token: a piece of data that proves identity or permissions, like a wristband at a festival.
- Username: an identifier for a user account.
- Wholesale prices: prices offered to businesses, often lower than retail.