Skip to content
Info disclosure Write-up Advanced

The Debug Filter That Read Masked Apigee Secrets

Apigee's Debug session filter could reference private variables (such as a KVM-loaded token) before masking was applied, so whether a transaction was captured revealed whether the secret started with a guessed prefix. An attacker with only Debug session permissions could recover a stable secret one character at a time without ever seeing it in the trace.

Nikita Markevich Follow

Published on bugs.exposed

Bounty$1,337 View original

Apigee's Debug feature has an awkward job. It must show enough of a live API transaction to explain why a proxy behaved the way it did, without turning every person who can troubleshoot that proxy into a reader of its secrets.

Nikita Markevich, on bugs.exposed

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

Apigee's Debug feature has an awkward job. It must show enough of a live API transaction to explain why a proxy behaved the way it did, without turning every person who can troubleshoot that proxy into a reader of its secrets.

Apigee handles that tension with two controls. A Debug session can use a filter to decide which transactions are worth recording, and data masking removes sensitive fields and variables from the result. Variables prefixed with private. receive an even stronger-looking treatment: they do not appear in Debug at all.

That sounds like a clean boundary. The debugger can inspect the execution, while values such as API keys, backend credentials, and private variables stay hidden. There was just one problem: the filter made its decision before those values disappeared.

On runtime 1-14-0-apigee-3, I could create a session whose filter asked whether private.token began with a chosen prefix. A match captured a transaction; a miss captured nothing. The token never appeared in the returned trace, but the presence of a transaction answered the question. Repeating that question recovered the value one character at a time.

Context: what a Debug session records

An Apigee API proxy is a pipeline of policies: verify a credential, read configuration, transform a message, call a backend, and so on. When that pipeline misbehaves, a Debug session records the steps taken by a small number of requests and the flow variables available along the way.

Sessions are deliberately bounded. They run for a limited time and collect only a limited number of transactions. On a busy proxy even that can be noisy, so the API accepts a condition in its filter field:

HTTP
POST /v1/organizations/ORG/environments/ENV/apis/API/revisions/REV/debugsessions
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/json

{
  "filter": "request.verb = \"POST\""
}

Only matching requests enter the session. The filter is therefore not a search over an already-produced trace; it is part of the capture decision itself.

Masking acts on the other side of that decision. An environment can mask selected JSON paths, XML paths, headers, and variables. Proxy code can also create a variable whose name begins with private.. Apigee documents that prefix as a way to prevent the variable from appearing in Debug output. A common pattern is to load a credential from a Key Value Map into a private variable:

XML
<KeyValueMapOperations name="LoadToken" mapIdentifier="secrets">
  <Get assignTo="private.token">
    <Key>
      <Parameter>backend-token</Parameter>
    </Key>
  </Get>
  <Scope>environment</Scope>
</KeyValueMapOperations>

The useful security question was not whether private.token appeared in the response. It did not. The question was whether the filter could still refer to it.

Setup

The work was done against Google Cloud Apigee, affected version 1-14-0-apigee-3, reported on 25 December 2024. The issue was later marked patched, and the bounty was USD 1,337.

My first script used one Environment Admin identity to prepare the fixture and run the attack. That made the demo easy to reproduce, but it also made the result look circular: an Environment Admin could already manage the KVM.

So I split the experiment into two identities.

Identity What it did What it could access
Setup account Stored a random token in the test KVM KVM management only for preparing the fixture
Debug account Created, read, listed, and deleted Debug sessions Trace sessions, but not the KVM

The Debug account had only these permissions:

Text
apigee.tracesessions.create
apigee.tracesessions.get
apigee.tracesessions.list
apigee.tracesessions.delete

The setup account stopped participating as soon as it had inserted the token. A separate traffic loop kept requests moving through the deployed proxy. The Debug account then reconstructed the token solely from empty and non-empty session results; a direct KVM read with that identity failed.

Finding it

I started with a known random token and two otherwise identical sessions. Their filters differed by one guessed character:

Text
private.token StartsWith "a"
private.token StartsWith "b"

After sending the same request through the proxy, one session contained a transaction ID and the other was empty. Changing the first character of the stored token changed which session captured the request. Masking was working, the private variable was absent from the trace, but it was working too late to hide the filter's verdict.

The effective order looked like this: the filter is evaluated against the live message context, the capture-or-ignore branch is taken, and only then is masking applied to the trace that gets collected.

That capture-or-ignore branch is a boolean oracle. It does not reveal the secret directly; it answers a series of yes-or-no questions about it. StartsWith made those questions especially convenient because every successful answer preserved the prefix for the next round.

Exploitation

Step 1: create a filtered session

The decisive API interactions were small. Create a filtered session, generate a request carrying the target value, then list the transaction IDs recorded by the session:

HTTP
GET /v1/organizations/ORG/environments/ENV/apis/API/revisions/REV/debugsessions/SESSION/data
Authorization: Bearer ACCESS_TOKEN

A match returned an ID; a miss returned an empty list. The response never needed to include private.token:

Text
// matching prefix
["0"]

// non-matching prefix
[]

Step 2: turn the session result into a bit

I wrapped those calls in a prefix search. The following is reduced from the proof of concept to show the extraction logic; authentication, polling, cleanup, and retry handling are omitted:

Python
def matches(prefix):
    session_id = create_debug_session(
        filter=f'private.token StartsWith "{prefix}"'
    )
    send_request_through_proxy()
    return bool(list_transaction_ids(session_id))

prefix = ""
for position in range(EXPECTED_LENGTH):
    for char in ALPHABET:
        if matches(prefix + char):
            prefix += char
            print(prefix)
            break
    else:
        raise RuntimeError(f"no candidate matched at offset {position}")

Each call creates a session whose filter tests one candidate extension of the known prefix, drives a request through the proxy so the variable is populated, and then checks whether any transaction was recorded. A non-empty list means the guess was right, and the prefix grows by one character.

Step 3: account for the cost

If the alphabet contains 64 characters, recovering a character takes 32 guesses on average. That makes the technique much slower and noisier than a direct disclosure. It also needs repeatable traffic: every guess has to reach the code path that populates the same variable with the same value. A rapidly changing nonce is a poor target; a long-lived API key is not.

The KVM token was a deterministic test fixture, not a special property of the bug. The filter operated on flow variables, so other stable values available during proxy execution were candidates too. Examples included a masked incoming header such as request.header.X-API-Key or a credential exposed to the proxy by an authentication policy. Whether a particular value was practical to recover depended on knowing its variable name and being able to make it recur while the sessions were active.

Step 4: prove the permission boundary

This separation was the point of the finding. It was not interesting that a KVM administrator could learn a KVM value. It was interesting that a role intended to operate Debug sessions could query information that Debug deliberately refused to display.

There were still meaningful limits. The account needed access to the target proxy's trace sessions, a useful guess at the variable name, and enough recurring traffic to ask many questions. I did not demonstrate cross-organization access, nor did the primitive magically enumerate every secret in an environment. It turned a stable, known variable into a queryable one.

Root cause

The mistake is ordering. The filter expression is parsed and evaluated against the live message context to decide whether a transaction is captured. Masking, including the private. prefix handling, is applied to the trace afterwards. The capture decision therefore branches on the raw value, and the branch outcome is observable through the session's transaction list even though the value itself is redacted.

In the public Apigee Hybrid runtime images, the relevant implementation made the separation unusually clear. FlowDebugSessionManager parsed the submitted filter into a normal Apigee expression, while the masking configuration travelled separately into the Debug service:

Text
LogicExpression filter = session.getFilter()
    .map(ExpressionParser::parseLogicExpression)
    .orElse(null);

debugService.createSession(
    session.getName(),
    session.getOriginalAuthority(),
    session.getMaskConfiguration(),
    ...
);
registerFiltersMarkers(session, filter);

That split explains the oracle: the expression tree made the capture decision from the live message context, and masking shaped the trace collected after that decision.

The private. prefix removed the variable from the trace, but nothing prevented the filter from referencing it.

Impact

An identity that can create and read Debug sessions on a proxy could recover stable secrets processed by that proxy, provided it knows or guesses the variable name and can generate recurring traffic that populates the same value. Candidate values included credentials loaded from a Key Value Map into private variables, masked incoming headers, or credentials exposed by an authentication policy.

The account did not need read access to the KVM or other secret store. In my test, a direct KVM read with the Debug identity failed while the token was still reconstructed from session results.

We disagreed about the severity. Google's view was that masking primarily prevents accidental exposure and is not a strong authorization boundary for someone who can debug a proxy. I thought that undersold environments where engineers can inspect production behaviour but cannot change and redeploy production code. In that model, "may run a trace" and "may read every secret processed by this proxy" are very different permissions.

The technique is slow and noisy compared with direct disclosure, and it did not magically enumerate every secret in an environment. It turns a stable, known variable into a queryable one.

Fix

I reported the issue on Christmas Day. The initial reproduction was accepted only after I separated the setup identity from the Debug identity, which was fair: the cleaner experiment made the permission boundary impossible to miss. Google awarded $1,337 and later marked the issue fixed.

After the fixed notice, I went back to the public Apigee Hybrid runtime images to see whether the patch was visible there. The public images did not reveal the fix. FlowDebugSessionManager, MessageDebugInterest, and the Debug masking utility were byte-for-byte identical in Hybrid 1.14.0, 1.14.1, and 1.14.2. There was no new check for private.* variables in those classes and no sign that masking had moved ahead of the filter.

Because my report concerned the managed runtime, the product team could have fixed the issue in the control plane, for example by rejecting protected variable names when a session is created, or in managed-only code that is absent from the Hybrid image. The static artefacts narrow the possibilities, but they do not identify which of those paths Google chose.

  • Other stable flow variables. Try filters on variables such as request.header.X-API-Key or credentials exposed by an authentication policy. A positive result is a session that records a transaction for a guessed prefix while the variable itself is masked or absent from the trace.
  • Other comparison operators. Instead of StartsWith, test equality or range-style conditions on a known variable. A positive result is any filter that changes the captured transaction count based on the hidden value.
  • Different masking mechanisms. Test environment-level masking of JSON paths, XML paths, headers, and variables rather than only the private. prefix. A positive result is an oracle on a value that the trace redacts.
  • Long-lived versus rotating values. Compare a long-lived API key with a rapidly changing nonce. A positive result is reliable extraction for the stable value and failure for the rotating one, confirming the repeatability requirement.
  • Permission separation. Run the attack with an identity that has only apigee.tracesessions.create, get, list, and delete, and confirm that a direct read of the secret store fails. A positive result is token recovery without secret-store access.

What stayed with me was not the prefix loop; that part was almost mechanical. It was how convincing the empty field looked. The UI showed no token, the API returned no token, and the private-variable feature appeared to have done its job. But confidentiality had already been lost one stage earlier, when a selector was allowed to branch on the raw value. Redaction is only as strong as the earliest observable decision made with the data.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 20 min read.

What happened, in plain words

Google Cloud Apigee is a service that companies use to run and manage their APIs. An API is the doorway through which one piece of software talks to another: for example, a phone app asking a shop's server for a list of products. Apigee sits in front of those doorways, checks who is calling, adds or removes information, and passes the request on to the company's own systems.

Apigee has a troubleshooting tool called Debug. When something goes wrong with an API, an engineer can start a Debug session, send some traffic through, and look at a recording of what happened at each step. That recording is called a trace.

A trace is useful, but it can also be dangerous, because the steps of a request often contain secrets: API keys, passwords for backend systems, and similar values. Apigee therefore has two protections:

  1. A filter, which decides which requests are worth recording at all. If you only care about failed requests, you tell the session to record only those.
  2. Masking, which removes sensitive values from the recording before anyone reads it. Values whose names start with private. are supposed to be removed completely.

On the version tested, 1-14-0-apigee-3, the filter appeared to make its decision before masking was applied. The filter looked at the real, unmasked value to decide whether to record a request, and only afterwards was the value hidden. The hidden value never appeared in the trace, but the simple fact that a request was recorded told the person watching whether the filter's question had been answered with yes.

By asking a series of yes-or-no questions of the form "does this secret start with these letters?", the researcher recovered the secret one character at a time. The account doing this could not read the place where the secret was stored. It only had permission to run Debug sessions.

Google paid USD 1,337 and marked the issue fixed. Google and the researcher disagreed about how serious it was: Google saw masking as protection against accidents rather than a strict permission boundary, while the researcher argued that being allowed to trace a system should not mean being allowed to read every secret that passes through it.

Background: what a Debug session records

To follow the rest of this, you need a rough picture of how Apigee works.

An API proxy in Apigee is a chain of steps. Each step does one small job: check a credential, read a setting, change a message, call the company's backend server, and so on. Apigee calls these steps policies. Think of it as an assembly line where each worker performs one task on a parcel before passing it on.

When the assembly line misbehaves, you want to watch a few parcels go past and note what each worker did. That is what a Debug session does: it records the steps taken by a small number of requests, plus the flow variables available along the way. A flow variable is simply a named value that exists while a request is being processed, such as the request's HTTP method or a header it carried. If you have ever used a spreadsheet, a flow variable is like a named cell: a label with a value inside.

Sessions are deliberately limited. They run for a limited time and collect only a limited number of transactions. On a busy proxy, even that can be too much noise, so the API lets you supply a condition in a field called filter:

HTTP
POST /v1/organizations/ORG/environments/ENV/apis/API/revisions/REV/debugsessions
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/json

{
  "filter": "request.verb = \"POST\""
}

Line by line:

  • POST /v1/organizations/ORG/environments/ENV/apis/API/revisions/REV/debugsessions is the address the tool calls to create a new Debug session. POST means "create something". The words in capitals (ORG, ENV, API, REV) are placeholders for the organisation, environment, API and revision you are working with. An environment is a separate copy of a setup, for example one for testing and one for live traffic.
  • Authorization: Bearer ACCESS_TOKEN is how the caller proves who it is. A token is a long string that acts like a temporary pass: the server checks it and, if it is valid, treats the caller as the account it belongs to. Bearer just means "the holder of this token is allowed in". ACCESS_TOKEN is a placeholder for the real value.
  • Content-Type: application/json says the body of the request is written in JSON, a common text format for structured data.
  • The body contains one setting, filter, whose value is request.verb = "POST". In plain words: "only record requests whose HTTP method is POST". The backslashes are there because the quotes inside the value have to be escaped inside JSON.

Only requests that match the filter enter the session. This is the key point: the filter is not a search over a recording that already exists. It is part of the decision about whether to record anything at all. It is like a security guard at the door deciding who gets into the room, rather than someone reviewing the CCTV footage afterwards.

Masking works on the other side of that decision. An environment can mask selected JSON paths, XML paths, headers and variables. JSON and XML are text formats for structured data; a path is a way of pointing at one specific field inside such a document, a bit like a postal address for a value. A header is a small labelled piece of information attached to every web request, such as the browser type or an API key.

Proxy code can also create a variable whose name begins with private.. Apigee documents that prefix as a way to prevent the variable from appearing in Debug output. A common pattern is to load a credential from a Key Value Map into a private variable. A Key Value Map, or KVM, is a small store of named settings kept inside Apigee: a list of labels and their values, like a shared address book for configuration.

XML
<KeyValueMapOperations name="LoadToken" mapIdentifier="secrets">
  <Get assignTo="private.token">
    <Key>
      <Parameter>backend-token</Parameter>
    </Key>
  </Get>
  <Scope>environment</Scope>
</KeyValueMapOperations>

Line by line:

  • <KeyValueMapOperations name="LoadToken" mapIdentifier="secrets"> starts a policy called LoadToken that works with a Key Value Map named secrets.
  • <Get assignTo="private.token"> says: fetch a value from the map and store it in a variable called private.token. Because the name starts with private., Apigee is supposed to keep it out of Debug output.
  • <Key><Parameter>backend-token</Parameter></Key> names the entry to fetch: the one labelled backend-token.
  • </Get> closes the fetch instruction.
  • <Scope>environment</Scope> says the map belongs to the environment, so it is shared by everything running in that environment.
  • </KeyValueMapOperations> closes the policy.

The useful security question was not whether private.token appeared in the response. It did not. The question was whether the filter could still refer to it. In other words: even if the value is hidden from the recording, can the guard at the door still be asked questions about it?

Setting up the experiment

The work was done against Google Cloud Apigee, affected version 1-14-0-apigee-3, and reported on 25 December 2024. The issue was later marked patched, and the bounty was USD 1,337. A bounty is a payment a company makes to someone who reports a security problem responsibly.

The first script used one Environment Admin identity to both prepare the test data and run the attack. An identity here means an account with a set of permissions. Environment Admin is a powerful role that can manage the environment, including its Key Value Maps. That made the demonstration easy to reproduce, but it also made the result look circular: an Environment Admin could already read the KVM directly, so recovering the token through Debug proved little.

So the experiment was split into two identities.

Identity What it did What it could access
Setup account Stored a random token in the test KVM KVM management only for preparing the fixture
Debug account Created, read, listed, and deleted Debug sessions Trace sessions, but not the KVM

The Debug account had only these permissions:

Text
apigee.tracesessions.create
apigee.tracesessions.get
apigee.tracesessions.list
apigee.tracesessions.delete

Line by line:

  • apigee.tracesessions.create allows starting a new Debug session.
  • apigee.tracesessions.get allows reading the details of a session.
  • apigee.tracesessions.list allows listing sessions.
  • apigee.tracesessions.delete allows removing a session.

None of these permissions allows reading the Key Value Map. That is the whole point: the account can watch traffic, but it cannot open the drawer where the secret is kept.

The setup account stopped participating as soon as it had inserted the token. A separate traffic loop kept requests moving through the deployed proxy, so there was always something for a session to record. The Debug account then reconstructed the token solely from empty and non-empty session results, and a direct KVM read with that identity failed. This is the difference between "the person with the master key can open the safe" and "the person with the CCTV monitor can read the combination".

Finding the problem

The researcher started with a known random token and two otherwise identical sessions. Their filters differed by one guessed character:

Text
private.token StartsWith "a"
private.token StartsWith "b"

Line by line:

  • private.token StartsWith "a" asks: does the hidden variable private.token begin with the letter a?
  • private.token StartsWith "b" asks the same question with b instead.

After sending the same request through the proxy, one session contained a transaction ID and the other was empty. A transaction ID is simply a label for one recorded request, so "contains an ID" means "this session recorded the request" and "empty" means "it did not". Changing the first character of the stored token changed which session captured the request. Masking was working, in that the private variable was absent from the trace, but it was working too late to hide the filter's verdict.

The effective order looked like this: the filter is evaluated against the live message context, the capture-or-ignore branch is taken, and only then is masking applied to the trace that gets collected. A branch is a point in a program where it goes one way or another depending on a condition, like a railway switch.

That capture-or-ignore branch is a boolean oracle. A boolean is a value that is either true or false. An oracle is anything that answers a question you are not supposed to be able to answer, even indirectly. The branch does not reveal the secret directly; it answers a series of yes-or-no questions about it. StartsWith made those questions especially convenient, because every successful answer preserved the prefix for the next round: once you know the first letter, you ask about the first two, and so on.

Exploiting it

Step 1: create a filtered session

The decisive API interactions were small. Create a filtered session, generate a request carrying the target value, then list the transaction IDs recorded by the session:

HTTP
GET /v1/organizations/ORG/environments/ENV/apis/API/revisions/REV/debugsessions/SESSION/data
Authorization: Bearer ACCESS_TOKEN

Line by line:

  • GET means "read something". The address points at the recorded data of one specific session, identified by SESSION.
  • Authorization: Bearer ACCESS_TOKEN again proves who is calling.

A match returned an ID; a miss returned an empty list. The response never needed to include private.token:

Text
// matching prefix
["0"]

// non-matching prefix
[]

Line by line:

  • ["0"] is a list containing one entry, the transaction ID 0. It means the filter matched and the request was recorded.
  • [] is an empty list. It means the filter did not match and nothing was recorded.

That difference, one entry versus none, is the entire leak. The secret itself is never shown; only the answer to the question is.

Step 2: turn the session result into a bit

The researcher wrapped those calls in a prefix search. The following is reduced from the proof of concept to show the extraction logic; authentication, polling, cleanup and retry handling are omitted. A proof of concept is a small program that demonstrates a problem is real without being a finished attack tool.

Python
def matches(prefix):
    session_id = create_debug_session(
        filter=f'private.token StartsWith "{prefix}"'
    )
    send_request_through_proxy()
    return bool(list_transaction_ids(session_id))

prefix = ""
for position in range(EXPECTED_LENGTH):
    for char in ALPHABET:
        if matches(prefix + char):
            prefix += char
            print(prefix)
            break
    else:
        raise RuntimeError(f"no candidate matched at offset {position}")

Line by line:

  • def matches(prefix): defines a small helper that answers one question: does the secret start with prefix?
  • session_id = create_debug_session( starts a new Debug session and remembers its identifier.
  • filter=f'private.token StartsWith "{prefix}"' builds the filter text, inserting the guessed prefix into the question. The f before the quote means Python will substitute the value of prefix into the string.
  • send_request_through_proxy() pushes one request through the proxy so that the variable is filled in with its real value.
  • return bool(list_transaction_ids(session_id)) asks for the recorded transaction IDs and converts the result to true or false: a non-empty list becomes true, an empty list becomes false.
  • prefix = "" starts with an empty known prefix.
  • for position in range(EXPECTED_LENGTH): repeats once for each character to recover. EXPECTED_LENGTH is how long the secret is believed to be.
  • for char in ALPHABET: tries every possible character in turn. ALPHABET is the set of characters the secret might contain.
  • if matches(prefix + char): asks whether the secret starts with the known prefix plus this candidate character.
  • prefix += char records the correct character by adding it to the known prefix.
  • print(prefix) shows the progress so far.
  • break stops trying further characters once one works.
  • else: belongs to the inner loop and runs only if no character matched.
  • raise RuntimeError(f"no candidate matched at offset {position}") stops the program with an error, because something unexpected happened, such as a wrong alphabet or a secret that changed.

Each call creates a session whose filter tests one candidate extension of the known prefix, drives a request through the proxy so the variable is populated, and then checks whether any transaction was recorded. A non-empty list means the guess was right, and the prefix grows by one character. It is like guessing a password letter by letter, where the only feedback is a light that turns on when the beginning is correct.

Step 3: account for the cost

If the alphabet contains 64 characters, recovering a character takes 32 guesses on average. That makes the technique much slower and noisier than a direct disclosure. It also needs repeatable traffic: every guess has to reach the code path that populates the same variable with the same value. A rapidly changing nonce is a poor target; a long-lived API key is not. A nonce is a value meant to be used once, so it changes constantly and cannot be guessed in a long series of questions.

The KVM token was a deterministic test fixture, not a special property of the bug. Deterministic means it behaves the same way every time. The filter operated on flow variables, so other stable values available during proxy execution were candidates too. Examples included a masked incoming header such as request.header.X-API-Key or a credential exposed to the proxy by an authentication policy. Whether a particular value was practical to recover depended on knowing its variable name and being able to make it recur while the sessions were active.

Step 4: prove the permission boundary

This separation was the point of the finding. It was not interesting that a KVM administrator could learn a KVM value. It was interesting that a role intended to operate Debug sessions could query information that Debug deliberately refused to display.

There were still meaningful limits. The account needed access to the target proxy's trace sessions, a useful guess at the variable name, and enough recurring traffic to ask many questions. The researcher did not demonstrate cross-organisation access, nor did the primitive magically enumerate every secret in an environment. A primitive here means a basic building block of an attack: a small capability that can be repeated. It turned a stable, known variable into a queryable one.

Root cause

The mistake is ordering. The filter expression is parsed and evaluated against the live message context to decide whether a transaction is captured. Parsed means the text of the filter is turned into a structure the program can work with. Masking, including the private. prefix handling, is applied to the trace afterwards. The capture decision therefore branches on the raw value, and the branch outcome is observable through the session's transaction list even though the value itself is redacted. Redacted means removed or blanked out before display.

In the public Apigee Hybrid runtime images, the relevant implementation made the separation unusually clear. Hybrid is a way of running Apigee partly on the customer's own infrastructure. An image is a packaged copy of software that can be downloaded and run. FlowDebugSessionManager parsed the submitted filter into a normal Apigee expression, while the masking configuration travelled separately into the Debug service:

Text
LogicExpression filter = session.getFilter()
    .map(ExpressionParser::parseLogicExpression)
    .orElse(null);

debugService.createSession(
    session.getName(),
    session.getOriginalAuthority(),
    session.getMaskConfiguration(),
    ...
);
registerFiltersMarkers(session, filter);

Line by line:

  • LogicExpression filter = session.getFilter() takes the filter text that was submitted with the session.
  • .map(ExpressionParser::parseLogicExpression) turns that text into a structured expression the program can evaluate. map means "if there is a value, apply this step to it".
  • .orElse(null) says: if there was no filter, use nothing instead.
  • debugService.createSession( starts creating the actual Debug session in the Debug service.
  • session.getName(), passes the session's name.
  • session.getOriginalAuthority(), passes who originally created it.
  • session.getMaskConfiguration(), passes the masking settings as a separate item.
  • ... stands for other arguments not shown.
  • ); closes the call.
  • registerFiltersMarkers(session, filter); registers the parsed filter with the session.

That split explains the oracle: the expression tree made the capture decision from the live message context, and masking shaped the trace collected after that decision. The filter and the mask travel on separate paths.

Authorisation is the process of deciding whether someone is allowed to do something. The private. prefix removed the variable from the trace, but nothing prevented the filter from referencing it.

Impact

An identity that can create and read Debug sessions on a proxy could recover stable secrets processed by that proxy, provided it knows or guesses the variable name and can generate recurring traffic that populates the same value. Candidate values included credentials loaded from a Key Value Map into private variables, masked incoming headers, or credentials exposed by an authentication policy.

The account did not need read access to the KVM or other secret store. In the test, a direct KVM read with the Debug identity failed while the token was still reconstructed from session results.

Google and the researcher disagreed about the severity. Google's view was that masking primarily prevents accidental exposure and is not a strong authorisation boundary for someone who can debug a proxy. The researcher thought that undersold environments where engineers can inspect production behaviour but cannot change and redeploy production code. In that model, "may run a trace" and "may read every secret processed by this proxy" are very different permissions.

The technique is slow and noisy compared with direct disclosure, and it did not magically enumerate every secret in an environment. It turns a stable, known variable into a queryable one.

The fix

The issue was reported on Christmas Day. The initial reproduction was accepted only after the setup identity was separated from the Debug identity, which was fair: the cleaner experiment made the permission boundary impossible to miss. Google awarded USD 1,337 and later marked the issue fixed.

After the fixed notice, the researcher went back to the public Apigee Hybrid runtime images to see whether the patch was visible there. A patch is a change that fixes a problem. The public images did not reveal the fix. FlowDebugSessionManager, MessageDebugInterest and the Debug masking utility were byte-for-byte identical in Hybrid 1.14.0, 1.14.1 and 1.14.2. Byte-for-byte identical means the files were exactly the same, with no changes at all. There was no new check for private.* variables in those classes and no sign that masking had moved ahead of the filter. A class is a building block of a program that groups related code together.

Because the report concerned the managed runtime, the product team could have fixed the issue in the control plane, for example by rejecting protected variable names when a session is created, or in managed-only code that is absent from the Hybrid image. The managed runtime is the version Google runs for customers on its own servers, and the control plane is the part that manages configuration rather than handling traffic. The static artefacts narrow the possibilities, but they do not identify which of those paths Google chose. Static artefacts means files you can inspect without running the software.

  • Other stable flow variables. Try filters on variables such as request.header.X-API-Key or credentials exposed by an authentication policy. A positive result is a session that records a transaction for a guessed prefix while the variable itself is masked or absent from the trace.
  • Other comparison operators. Instead of StartsWith, test equality or range-style conditions on a known variable. A positive result is any filter that changes the captured transaction count based on the hidden value.
  • Different masking mechanisms. Test environment-level masking of JSON paths, XML paths, headers and variables rather than only the private. prefix. A positive result is an oracle on a value that the trace redacts.
  • Long-lived versus rotating values. Compare a long-lived API key with a rapidly changing nonce. A positive result is reliable extraction for the stable value and failure for the rotating one, confirming the repeatability requirement.
  • Permission separation. Run the attack with an identity that has only apigee.tracesessions.create, get, list and delete, and confirm that a direct read of the secret store fails. A positive result is token recovery without secret-store access.

What stayed with the researcher was not the prefix loop; that part was almost mechanical. It was how convincing the empty field looked. The UI showed no token, the API returned no token, and the private-variable feature appeared to have done its job. But confidentiality had already been lost one stage earlier, when a selector was allowed to branch on the raw value. Redaction is only as strong as the earliest observable decision made with the data.

Glossary

  • API: the doorway through which one piece of software talks to another, for example an app asking a server for data.
  • API proxy: an Apigee configuration that sits in front of a backend and runs a chain of steps on each request.
  • Apigee: Google Cloud's service for managing and protecting APIs.
  • Authorisation: the process of deciding whether someone is allowed to do something.
  • Boolean: a value that is either true or false.
  • Bounty: a payment a company makes to someone who reports a security problem responsibly.
  • Branch: a point in a program where it goes one way or another depending on a condition.
  • Byte-for-byte identical: exactly the same file content, with no changes at all.
  • Class: a building block of a program that groups related code together.
  • Control plane: the part of a service that manages configuration rather than handling live traffic.
  • Debug session: an Apigee recording of a small number of requests and the steps taken while processing them.
  • Deterministic: behaving the same way every time.
  • Environment: a separate copy of a setup, for example one for testing and one for live traffic.
  • Filter: a condition that decides which requests a Debug session records.
  • Flow variable: a named value that exists while a request is being processed, such as a header or a stored credential.
  • Header: a small labelled piece of information attached to a web request or response.
  • Hybrid: a way of running Apigee partly on the customer's own infrastructure.
  • Identity: an account with a set of permissions.
  • Image: a packaged copy of software that can be downloaded and run.
  • JSON: a common text format for structured data.
  • Key Value Map (KVM): a small store of named settings kept inside Apigee.
  • Managed runtime: the version of a service that the provider runs for customers on its own servers.
  • Masking: removing or hiding sensitive values from a recording before anyone reads it.
  • Nonce: a value meant to be used once, so it changes constantly.
  • Oracle: anything that answers a question you are not supposed to be able to answer, even indirectly.
  • Parsed: turned from text into a structure a program can work with.
  • Patch: a change that fixes a problem.
  • Path: a way of pointing at one specific field inside a structured document.
  • Policy: one step in an Apigee proxy, such as checking a credential or calling a backend.
  • Primitive: a basic building block of an attack, a small capability that can be repeated.
  • Proof of concept: a small program that demonstrates a problem is real without being a finished attack tool.
  • Redacted: removed or blanked out before display.
  • Static artefacts: files you can inspect without running the software.
  • Token: a long string that acts as a temporary pass, proving who the caller is.
  • Trace: the recording produced by a Debug session.
  • Transaction ID: a label for one recorded request.
  • XML: a common text format for structured data.

More by Nikita Markevich

View all

11 more disclosed reports, best first.

More from Google

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.