Skip to content
Info disclosure Disclosed report Intermediate

Amazon Comprehend Medical Service Reporting "AWS Internal" for CloudTrail Events Generated from FIPS Endpoints

Eight Comprehend Medical API endpoints, all FIPS endpoints, log CloudTrail events with the user-agent and network information shown as "AWS Internal" instead of the caller's real details. An attacker using these endpoints could hide their source IP address and user agent from defenders reviewing CloudTrail logs.

nick_frichette_dd Follow

Originally disclosed on HackerOne

Medium 5.0 View original
  • Fixed in 14 days
  • Disclosed after 19 days

Description: When performing calls to the AWS API, AWS CloudTrail is responsible for logging that API activity for customers. These CloudTrail event logs contain information about the API call, when it was performed, by whom, etc.

We have found 8 API endpoints for the Comprehend Medical service that incorrectly report the user-agent and network information as "AWS Internal". As a result of this, an adversary can perform API calls using these endpoints and evade the logging of their IP address/operating system information.

As a coincidence, these 8 API endpoints are all FIPS endpoints. It's entirely possible that this was an intentional decision, however I haven't run into it before and therefore wanted to report it in case that was not the case.

Steps To Reproduce:

First, as a base line, perform the following AWS CLI command:

aws comprehendmedical list-phi-detection-jobs

Wait 5-10 minutes for this event to appear in CloudTrail. From here, inspect the CloudTrail log and see that the UserAgent field is populated, as well as the source IP address.

Next, run the following command:

aws comprehendmedical list-phi-detection-jobs --endpoint-url █████████

Wait 5-10 minutes for this event to appear in CloudTrail. From here, inspect the CloudTrail log and see that the UserAgent field and network information is "AWS Internal". Because of this endpoint we used, we cannot see the request information which may degrade a defenders ability to track down an adversary.

List of endpoints exhibiting this behavior

  • ████████
  • comprehendmedical-fips.us-east-1.api.aws
  • ████
  • ███████
  • ███
  • █████
  • ████████
  • ██████

Impact

Summary:

An adversary can use these endpoints to avoid disclosing their source IP address or user agent information to the victim.

The original report as published on HackerOne, by nick_frichette_dd. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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. 5 min read.

Context

AWS CloudTrail is the service that records API activity in an AWS account. When a customer calls an AWS API, CloudTrail writes an event that describes the call: which API was invoked, when, by whom, and from where. Among the fields in that event are the source IP address and the UserAgent, which together let a defender attribute a call to a particular client and network location.

Amazon Comprehend Medical is the AWS service for extracting medical information from text. Its API includes operations such as listing PHI detection jobs. The report concerns the CloudTrail events generated when those operations are called through a particular set of endpoints.

The researcher found that eight API endpoints for Comprehend Medical cause CloudTrail to record the user-agent and network information as "AWS Internal" instead of the real client details. All eight are FIPS endpoints. The researcher notes that this could be an intentional decision, but had not encountered the behaviour before and reported it in case it was not.

Setup

The only tool shown in the report is the AWS CLI, used against an AWS account with access to Comprehend Medical. The precondition for observing the behaviour is the ability to read the resulting CloudTrail events, and enough patience to wait for them to appear: the report instructs waiting 5 to 10 minutes after each call before inspecting the log.

Finding it

The researcher started from the normal behaviour of CloudTrail as a baseline, then compared it with the behaviour when the same API call is sent to an alternate endpoint URL. In the baseline case the event contains the client's UserAgent and source IP address. In the endpoint-override case both the UserAgent field and the network information read "AWS Internal".

That difference is what makes the behaviour interesting from a defensive point of view: the log entry still exists, but the fields a defender would use to attribute the call no longer describe the caller. The researcher also observed that the eight affected endpoints are all FIPS endpoints, and noted it is entirely possible this was an intentional decision.

Exploitation

Step 1: Establish the baseline

Run the following AWS CLI command against the default endpoint:

Bash
aws comprehendmedical list-phi-detection-jobs

This invokes the Comprehend Medical operation that lists PHI detection jobs. Wait 5 to 10 minutes for the event to appear in CloudTrail, then inspect the log. The UserAgent field is populated, and the source IP address is present.

Step 2: Repeat the call against a FIPS endpoint

Run the same operation, this time overriding the endpoint URL:

Bash
aws comprehendmedical list-phi-detection-jobs --endpoint-url █████████

The --endpoint-url option makes the CLI send the request to the specified endpoint instead of the service's default one. This time the UserAgent field and the network information read "AWS Internal".

Because of the endpoint used, the request information that would normally identify the caller is not visible in the event, which may degrade a defender's ability to track down an adversary.

The affected endpoints

The report lists eight endpoints exhibiting the behaviour. Only one is shown in clear:

  • comprehendmedical-fips.us-east-1.api.aws

The remaining seven entries are redacted in the published report.

Root cause

The report does not identify a code-level cause. What it establishes is the observable behaviour: calls made through these eight Comprehend Medical FIPS endpoints produce CloudTrail events in which the UserAgent and network information are recorded as "AWS Internal" rather than as the caller's details. The researcher explicitly allows for the possibility that this is an intentional design decision for FIPS endpoints, and says only that the pattern was new to them. Whether the logging pipeline treats traffic arriving at these endpoints as internal AWS traffic, and why, is not stated.

Impact

An adversary can use these endpoints to avoid disclosing their source IP address or user agent information to the victim. The CloudTrail event for the call is still generated, but the fields that would normally attribute it to a network location and client are replaced with "AWS Internal", which may degrade a defender's ability to track down an adversary.

The impact is bounded by what the report actually shows: it concerns attribution data in CloudTrail for Comprehend Medical calls made through these endpoints, not the suppression of events altogether. The report does not describe any other consequence, and the researcher frames the finding as a possible unintended behaviour rather than a confirmed vulnerability.

Fix

The report does not describe any fix, and does not state what AWS changed in response. The implied remedy is for CloudTrail events generated from these endpoints to record the real source IP address and UserAgent, as the default endpoint does, or for the behaviour to be confirmed as intentional and documented.

Variants to test

  1. Other FIPS endpoints across AWS services. Call an operation through a service's FIPS endpoint and compare the resulting CloudTrail event with the same call through the default endpoint. A positive result is a UserAgent or source IP field reading "AWS Internal" where the baseline event shows the real values.
  2. Other regional and alternate endpoint forms for the same service. Repeat the baseline and endpoint-override comparison for each endpoint variant you can enumerate. A positive result is the same substitution of attribution fields in the CloudTrail event.
  3. Other services with dual endpoint sets. Apply the same two-call comparison to any service that exposes more than one endpoint family. A positive result is any endpoint where the event loses the caller's IP address or user agent.

Hunting notes

This kind of issue hides in the gap between how a request is routed and how it is logged. The signal is a CloudTrail event whose UserAgent or source IP reads "AWS Internal" for a call that a customer made from outside AWS. The comparison method in the report is the practical technique: make the same API call twice, once through the default endpoint and once through an alternate endpoint, wait for both events, and diff the attribution fields. Endpoint families worth enumerating are FIPS endpoints and any other alternate hostnames a service publishes.

The report is careful about intent, presenting the FIPS correlation as an observation and leaving open that the behaviour may be deliberate.

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. 10 min read.

What happened, in plain words

Amazon runs a service called Comprehend Medical, which is used to pull medical information out of text. Like most cloud services, it is operated through an API: a way for one computer program to ask another computer program to do something, over the internet. Think of it as a waiter taking your order to the kitchen. You do not walk into the kitchen yourself; you tell the waiter what you want, and the waiter brings it back.

Whenever someone uses an AWS API, AWS writes a record of that use into a logging service called CloudTrail. A log is simply a written record of what happened, like a shop's till roll or a building's visitor book. CloudTrail records things such as which operation was called, when, by whom, and from where. Two of the fields in that record are especially useful to anyone investigating an incident: the source IP address (roughly, the network address the request came from) and the UserAgent (a short label the client software sends to say what program and operating system it is).

The researcher found that eight API endpoints for Comprehend Medical cause CloudTrail to record the user-agent and network information as "AWS Internal" instead of the real client details. An endpoint is the specific address a request is sent to, like a particular counter in a large office building rather than the building's main reception. All eight of the affected endpoints are FIPS endpoints. FIPS is a set of US government security standards; a FIPS endpoint is a version of the service that is meant to comply with those standards.

The consequence is that someone making calls through these endpoints can avoid having their IP address and operating system information written into the log. The log entry still exists, but the parts that would identify the caller have been replaced with the words "AWS Internal". The researcher notes that this could be an intentional decision, but had not encountered the behaviour before and reported it in case it was not.

Context

What CloudTrail does

CloudTrail is the service that records API activity in an AWS account. When a customer calls an AWS API, CloudTrail writes an event that describes the call: which API was invoked, when, by whom, and from where. Among the fields in that event are the source IP address and the UserAgent, which together let a defender attribute a call to a particular client and network location. "Attribute" here means to work out who or what was responsible. If you have ever looked at a website's visitor log and seen an IP address and a browser name next to each visit, you have seen the same kind of information.

What Comprehend Medical does

Amazon Comprehend Medical is the AWS service for extracting medical information from text. Its API includes operations such as listing PHI detection jobs. PHI stands for protected health information, the kind of personal medical data that carries legal protection. A detection job is a task that scans text looking for such information. "Listing" the jobs means asking the service to show you the jobs that exist, in the same way you might ask a website to show you a list of your past orders.

The report concerns the CloudTrail events generated when those operations are called through a particular set of endpoints.

The finding

All eight are FIPS endpoints.

Setup

The only tool shown in the report is the AWS CLI, used against an AWS account with access to Comprehend Medical. The AWS CLI is a command-line interface: a program you run in a text window by typing commands, rather than clicking buttons on a web page. It is the difference between ordering by speaking to a person and ordering by filling in a form.

The precondition for observing the behaviour is the ability to read the resulting CloudTrail events, and enough patience to wait for them to appear: the report instructs waiting 5 to 10 minutes after each call before inspecting the log. That wait matters because logging is not always instant; the record can take a few minutes to show up, just as a bank transaction may not appear in your statement the second you make it.

Finding it

The researcher started from the normal behaviour of CloudTrail as a baseline, then compared it with the behaviour when the same API call is sent to an alternate endpoint URL. A baseline is a known-good reference point: you first record what normal looks like, so that when something differs you can point at the difference instead of guessing.

In the baseline case the event contains the client's UserAgent and source IP address. In the endpoint-override case both the UserAgent field and the network information read "AWS Internal".

That difference is what makes the behaviour interesting from a defensive point of view: the log entry still exists, but the fields a defender would use to attribute the call no longer describe the caller. A defender is the person or team trying to detect and investigate attacks. Losing attribution data is like a visitor book where the name column has been replaced with the word "someone": the visit is recorded, but the useful part is gone.

The researcher also observed that the eight affected endpoints are all FIPS endpoints, and noted it is entirely possible this was an intentional decision.

Exploitation

Step 1: Establish the baseline

Run the following AWS CLI command against the default endpoint:

Bash
aws comprehendmedical list-phi-detection-jobs

Line by line, in plain words:

  • aws is the name of the command-line program being run.
  • comprehendmedical selects the Comprehend Medical service, the medical text analysis service described above.
  • list-phi-detection-jobs is the operation: show me the PHI detection jobs. It is the instruction being sent to the service.

No endpoint is specified, so the CLI sends the request to the service's normal, default address. This invokes the Comprehend Medical operation that lists PHI detection jobs. Wait 5 to 10 minutes for the event to appear in CloudTrail, then inspect the log. The UserAgent field is populated, and the source IP address is present. This step exists to prove what normal looks like before changing anything.

Step 2: Repeat the call against a FIPS endpoint

Run the same operation, this time overriding the endpoint URL:

Bash
aws comprehendmedical list-phi-detection-jobs --endpoint-url █████████

Line by line, in plain words:

  • aws comprehendmedical list-phi-detection-jobs is exactly the same call as in step 1.
  • --endpoint-url is an option that tells the CLI to send the request somewhere other than the default address. The value after it is the address to use; in the published report that address is redacted, shown as a block of blacked-out characters.

The --endpoint-url option makes the CLI send the request to the specified endpoint instead of the service's default one. This time the UserAgent field and the network information read "AWS Internal".

Because of the endpoint used, the request information that would normally identify the caller is not visible in the event, which may degrade a defender's ability to track down an adversary. An adversary is an attacker: someone trying to do something they are not supposed to do, or to avoid being traced while doing it.

The affected endpoints

The report lists eight endpoints exhibiting the behaviour. Only one is shown in clear:

  • comprehendmedical-fips.us-east-1.api.aws

The remaining seven entries are redacted in the published report. The visible one follows a readable pattern: the service name, then fips, then a region (us-east-1), then api.aws. A region is a physical grouping of AWS data centres in one part of the world.

Root cause

The report does not identify a code-level cause. What it establishes is the observable behaviour: calls made through these eight Comprehend Medical FIPS endpoints produce CloudTrail events in which the UserAgent and network information are recorded as "AWS Internal" rather than as the caller's details.

The researcher explicitly allows for the possibility that this is an intentional design decision for FIPS endpoints, and says only that the pattern was new to them. Whether the logging pipeline treats traffic arriving at these endpoints as internal AWS traffic, and why, is not stated. A logging pipeline is the chain of steps that takes an event and writes it into the log, like a postal route from sender to filing cabinet; somewhere along that route the caller's details are being replaced.

Impact

An adversary can use these endpoints to avoid disclosing their source IP address or user agent information to the victim. The CloudTrail event for the call is still generated, but the fields that would normally attribute it to a network location and client are replaced with "AWS Internal", which may degrade a defender's ability to track down an adversary.

The impact is bounded by what the report actually shows: it concerns attribution data in CloudTrail for Comprehend Medical calls made through these endpoints, not the suppression of events altogether. In other words, the record is not deleted; it is less useful. The report does not describe any other consequence, and the researcher frames the finding as a possible unintended behaviour rather than a confirmed vulnerability.

Fix

The report does not describe any fix, and does not state what AWS changed in response. The implied remedy is for CloudTrail events generated from these endpoints to record the real source IP address and UserAgent, as the default endpoint does, or for the behaviour to be confirmed as intentional and documented.

Variants to test

  1. Other FIPS endpoints across AWS services. Call an operation through a service's FIPS endpoint and compare the resulting CloudTrail event with the same call through the default endpoint. A positive result is a UserAgent or source IP field reading "AWS Internal" where the baseline event shows the real values.
  2. Other regional and alternate endpoint forms for the same service. Repeat the baseline and endpoint-override comparison for each endpoint variant you can enumerate. A positive result is the same substitution of attribution fields in the CloudTrail event.
  3. Other services with dual endpoint sets. Apply the same two-call comparison to any service that exposes more than one endpoint family. A positive result is any endpoint where the event loses the caller's IP address or user agent.

Hunting notes

This kind of issue hides in the gap between how a request is routed and how it is logged. Routing is the path a request takes to reach the service; logging is what gets written down about it. When those two disagree, the log can describe a different caller from the one that actually made the call.

The signal is a CloudTrail event whose UserAgent or source IP reads "AWS Internal" for a call that a customer made from outside AWS. The comparison method in the report is the practical technique: make the same API call twice, once through the default endpoint and once through an alternate endpoint, wait for both events, and diff the attribution fields. To diff means to compare two things field by field and note what changed.

Endpoint families worth enumerating are FIPS endpoints and any other alternate hostnames a service publishes. Enumerating means listing them out systematically, the way you might list every entrance to a building before checking which ones are unlocked.

The report is careful about intent, presenting the FIPS correlation as an observation and leaving open that the behaviour may be deliberate.

Glossary

  • API: a defined way for one program to ask another program to do something, over a network.
  • AWS: Amazon Web Services, Amazon's cloud computing platform.
  • AWS CLI: a command-line program for sending commands to AWS by typing them in a text window.
  • Adversary: an attacker; someone acting against the interests of the account owner.
  • Attribution: working out who or what was responsible for an action, from clues such as an IP address or user agent.
  • Baseline: a known-good reference recording of normal behaviour, used for comparison.
  • CloudTrail: the AWS service that records API activity in an AWS account as events.
  • Comprehend Medical: the AWS service for extracting medical information from text.
  • Defender: the person or team trying to detect and investigate attacks.
  • Diff: to compare two records field by field and identify what changed.
  • Endpoint: the specific network address a request is sent to.
  • Enumerate: to list items out systematically.
  • Event: a single record written by CloudTrail describing one API call.
  • FIPS: a set of US government security standards; a FIPS endpoint is a version of a service intended to comply with them.
  • IP address: a numeric network address identifying where a request came from.
  • Log: a written record of events that happened.
  • Logging pipeline: the chain of steps that carries an event from happening to being written into a log.
  • PHI: protected health information, personal medical data that carries legal protection.
  • PHI detection job: a task that scans text looking for protected health information.
  • Region: a physical grouping of AWS data centres in one part of the world.
  • Routing: the path a request takes to reach the service that handles it.
  • UserAgent: a short label sent by client software describing the program and operating system making a request.
  • Vulnerability: a weakness that can be used to cause harm or to avoid controls.

More by nick_frichette_dd

View all

22 more disclosed reports, best first.

More from AWS VDP

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.