Skip to content
SSRF Disclosed report Intermediate

SSRF allows reading AWS EC2 metadata using "readapi" variable in Streamlabs Cloudbot

The Cloudbot custom-command feature fetched any HTTPS URL supplied in a readapi variable and echoed the response into chat. Because the backend followed redirects to HTTP, an attacker could reach the AWS EC2 metadata service and read instance metadata.

nrockhouse Follow

Originally disclosed on HackerOne

Bounty$200 Medium 5.0 View original
  • Triaged in 14 hours
  • Fixed in 24 hours
  • Paid in 19 hours
  • Disclosed after 3 days

Summary by the program

Detailed summary is provided by the hacker below.

Summary by the researcher

Summary:

Streamlabs Cloudbot is a customisable chatbot provided by Streamlabs which allows the creation of custom commands along with custom responses. These chat responses can take in "Variables" wrapped in curly brackets as documented in https://streamlabs.com/dashboard#/cloudbot/commands/variables, such as {{user.name}} which translates to the username of the viewer who executed the command in stream chat.

Some of these "Variables" can take in arguments, one of it is the readapi variable, in the form of {readapi.<url_here>}. When the custom command is executed, Cloudbot backend translates these "Variables" in the custom responses template into their respective values, and then sends it on the stream chat. To translate the readapi variable, an HTTPS request is sent to the provided URL, and then returns its response in place of the {readapi.<url_here>} variable. Example:

  • The server's IP is {readapi.https://api.ipify.org} -> The server's IP is xx.xxx.xxx.x.

However, the backend checks to see if the supplied URL is using the https:// protocol. If any other protocol is supplied, including http://, the backend simply replaces the variable with [Https required], as such:

  • The server's IP is {readapi.http://api.ipify.org} -> The server's IP is [Https required].

Other than that, there's other several caveats.

  1. The response has to be a common human-readable Content-Type. For example, having no Content-Type, or having text/plain, text/html, application/json as the Content-Type would return the response in chat successfully. Meanwhile, application/javascript, application/octet-stream or image/png would cause [Invalid Content-Type] to be shown.

  2. The response code must be 2xx, so 404 Not Found pages or 500 Internal Server Error pages are all replaced with [Bad Server Response / Too slow] in the chat.

  3. The timeout value is very low, my estimate is around 3000 ms. If the web server could not respond within this time frame, the connection is dropped and [Bad Server Response / Too slow] will be shown. This makes it hard to differentiate an open, closed, or filtered port when fingerprinting with SSRF port scanning in the backend server.

  4. There appears to be a limit for the content length, I did not test out what is the exact value for this, but anything exceeding this limit will simply not return anything, so abc{readapi.https://superbigsite/}def -> abcdef.

  5. The response data cannot contain any curly brackets { or }, which I believe is because it represents variables. The backend recursively translates variables until there are no variables left, so it may be to prevent infinite loops or at least a high number of requests being sent. Response data containing the symbols will simply not returning anything, same behaviour as mentioned in the point above.

The HTTPS-only requirement prevents me from querying the AWS EC2 metadata service directly, since it can only be requested via HTTP. Fortunately, Cloudbot's backend follows redirects, even if it's to an HTTP URL. I simply hosted a file slpoc.php on my server containing the following contents.

PHP
<?php header('Location: http://169.254.169.254/latest/meta-data/'); ?>

Then, a readapi variable is set to send a request to this PHP file. (The prefixing A and suffixing B is used to ensure I would get a reply even if the variable content is empty).

  • A{readapi.https://mydomain/slpoc.php}B -> Aami-id ami-launch-index ami-manifest-path block-device-mapping/ events/ hostname identity-credentials/ instance-action instance-id instance-type local-hostname local-ipv4 mac metrics/ network/ placement/ profile public-hostname public-ipv4 public-keys/ reservation-id security-groups services/B

As can be seen above, the EC2 instance does not have an IAM role assigned to it. This limits me from being able to escalate this further to file disclosure, RCE, or an AWS account takeover. Since Cloudbot runs on multiple different EC2 servers for load balancing, there may be potential misconfigured servers that my Cloudbot isn't running on which allows such an escalation, but not that I could find.

Attempts on redirecting to other protocols (ex. gopher://, ftp://, file://, dict://) have all returned [Bad Server Response / Too slow] with nothing hitting my test servers, which means the request library being used here in the backend is likely exclusively only for web requests.

Note that some AWS endpoints which return JSON data, such as http://169.254.169.254/latest/dynamic/instance-identity/document cannot be retrieved due to caveat number 5 as previous stated, which also further limited my ability to get access keys, even if an IAM role is attached.

The applied fix no longer follows redirects, the behaviour now is that it would simply throw [Bad Server Response / Too slow] for redirects, which should prevent anyone from querying the AWS metadata endpoint, or any HTTP URLs for that matter.

The original report as published on HackerOne, by nrockhouse. 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. 7 min read.

Context

Streamlabs Cloudbot is a customisable chatbot offered by Streamlabs. Stream viewers and streamers can create custom commands with custom response templates, and those templates can contain "Variables" wrapped in curly brackets. The variables are documented at https://streamlabs.com/dashboard#/cloudbot/commands/variables. A simple example is {{user.name}}, which is replaced with the username of the viewer who executed the command in stream chat.

When a custom command runs, the Cloudbot backend takes the response template, translates each variable into its value, and sends the resulting text to the stream chat. One of the available variables is readapi, written as {readapi.<url_here>}. To resolve it, the backend makes an HTTPS request to the supplied URL and substitutes the response body in place of the variable. For example:

  • The server's IP is {readapi.https://api.ipify.org} -> The server's IP is xx.xxx.xxx.x.

The feature is therefore a server-side fetch of an attacker-influenced URL, with the result reflected back into a chat message the attacker can read. That is the shape of a server-side request forgery (SSRF) with response disclosure.

Setup

The researcher hosted a redirect file on a server under their own control. No special role or privilege on the Streamlabs side is described.

The key precondition is that the readapi variable only accepts URLs using the https:// protocol. Any other protocol, including http://, is rejected by the backend, which replaces the variable with [Https required]:

  • The server's IP is {readapi.http://api.ipify.org} -> The server's IP is [Https required].

Because the AWS EC2 metadata service can only be reached over HTTP, this check appears to block the most obvious target. The rest of the work is about getting around that.

Finding it

The researcher mapped the behaviour of the readapi variable and found several caveats that constrain what can be read back through chat. These matter both for exploitation and for understanding why some payloads fail.

  1. The response must have a common human-readable Content-Type. A missing Content-Type, or text/plain, text/html or application/json, returns the response in chat successfully. application/javascript, application/octet-stream or image/png cause [Invalid Content-Type] to be shown.
  2. The response code must be 2xx. 404 Not Found and 500 Internal Server Error pages are replaced with [Bad Server Response / Too slow] in chat.
  3. The timeout is very low, estimated at around 3000 ms. If the web server does not respond within that window, the connection is dropped and [Bad Server Response / Too slow] is shown. This makes it hard to distinguish an open, closed or filtered port when fingerprinting with SSRF port scanning against the backend server.
  4. There appears to be a content length limit. The exact value was not tested, but anything exceeding it returns nothing, so abc{readapi.https://superbigsite/}def -> abcdef.
  5. The response data cannot contain curly brackets { or }. The researcher believes this is because they represent variables. The backend recursively translates variables until none are left, so the restriction may exist to prevent infinite loops or at least a high number of requests. Response data containing those symbols returns nothing, the same behaviour as the previous point.

The HTTPS-only requirement is the obstacle for reaching the metadata service. The Cloudbot backend follows redirects, even when the redirect target is an HTTP URL. That means an HTTPS URL the attacker controls can bounce the request to plain HTTP, and the protocol check is applied only to the URL supplied in the variable, not to the redirect destination.

Exploitation

Step 1: Host an HTTPS redirector

The researcher hosted a file slpoc.php on their own server with the following contents:

PHP
<?php header('Location: http://[redacted]/latest/meta-data/'); ?>

The script answers over HTTPS and issues a Location header pointing at the EC2 metadata service over HTTP. The backend follows it, so the request that actually reaches [redacted] is an HTTP request made by the Cloudbot server itself.

Step 2: Trigger the variable with a redirecting URL

The readapi variable was set to request the PHP file. The prefixing A and suffixing B are there to ensure a reply is visible even if the variable content is empty:

  • A{readapi.https://mydomain/slpoc.php}B -> Aami-id ami-launch-index ami-manifest-path block-device-mapping/ events/ hostname identity-credentials/ instance-action instance-id instance-type local-hostname local-ipv4 mac metrics/ network/ placement/ profile public-hostname public-ipv4 public-keys/ reservation-id security-groups services/B

The response is the directory listing of /latest/meta-data/ from the EC2 instance running the Cloudbot backend, delivered into stream chat between the A and B markers.

Step 3: Assess escalation

The listing shows that the EC2 instance has no IAM role assigned to it. That limits the finding: without instance credentials, the researcher could not escalate to file disclosure, RCE or an AWS account takeover. Cloudbot runs on multiple EC2 servers for load balancing, so there may be misconfigured servers that the researcher's Cloudbot was not running on and that would allow such escalation, but none were found.

Step 4: Test other protocols

Attempts to redirect to other protocols, such as gopher://, ftp://, file:// and dict://, all returned [Bad Server Response / Too slow] with nothing hitting the test servers. The request library used in the backend is therefore likely exclusively for web requests.

Step 5: Note the JSON limitation

Some AWS endpoints return JSON, such as http://[redacted]/latest/dynamic/instance-identity/document. These cannot be retrieved because of caveat 5: the JSON contains curly brackets, and response data containing { or } returns nothing. This further limited the ability to obtain access keys, even if an IAM role had been attached.

Root cause

The only protocol control is a check on the URL supplied in the variable: it must start with https://. The HTTP client, however, follows redirects, and the redirect target is not subjected to the same check. An attacker-controlled HTTPS endpoint can therefore redirect the backend to any HTTP URL, including the link-local metadata address [redacted].

Impact

An attacker with a Cloudbot custom command could make the backend issue HTTP requests to hosts reachable from the Cloudbot servers and read the responses in stream chat. In this instance that exposed the EC2 instance metadata directory listing, confirming SSRF against the internal metadata service. The absence of an IAM role on the affected instance prevented escalation to credential theft, file disclosure, RCE or AWS account takeover. Because Cloudbot runs across multiple EC2 servers, other instances with an IAM role attached might have allowed further escalation, but the researcher did not find one. The JSON metadata endpoints that would carry identity documents and credentials were also blocked by the curly-bracket restriction.

Fix

The applied fix stops the backend from following redirects. Redirects now produce [Bad Server Response / Too slow], which should prevent anyone from querying the AWS metadata endpoint, or any HTTP URL for that matter.

Variants to test

  • Redirect to link-local addresses. Host an HTTPS endpoint that returns a Location header to http://[redacted]/ and reference it through the variable. A positive result is metadata content appearing in the chat response.
  • Redirect to internal hostnames and RFC 1918 addresses. Point the redirect at internal services reachable from the backend. A positive result is any response body from an internal host, subject to the content-type and status-code caveats.
  • Redirect chains. Use multiple hops, mixing schemes, to see whether validation is applied only to the first URL. A positive result is a final HTTP response returned through the variable.
  • Other protocol handlers via redirect. Try gopher://, ftp://, file:// and dict:// as redirect targets. In this report they all failed, but the same test on another target may reveal a client that supports more than web requests.
  • Content-type and status filtering. Serve responses with different Content-Type values and status codes to map exactly what the backend will reflect. A positive result is a body returned for a type or code the report lists as blocked.
  • Length and character limits. Probe the maximum reflected length and whether curly brackets can be smuggled through encoding. A positive result is a longer body or a body containing { or } reaching chat.

Hunting notes

This kind of bug tends to hide in user-facing templating and variable features that fetch remote content: chat bots, link previews, webhook testers, avatar or image importers, RSS and feed readers, and URL unfurlers. The signal during recon is a documented variable or parameter that takes a URL and whose output is shown back to the user. Read the documentation for the exact syntax and any stated protocol restrictions, then test whether those restrictions survive redirects.

A second signal is a protocol allowlist that only checks the initial URL. Any feature that follows redirects is a candidate for a scheme or host bypass. Test with an HTTPS endpoint you control that redirects to HTTP, to link-local addresses, and to internal hosts, and watch for the reflected body.

The researcher showed enough impact by returning the EC2 metadata directory listing in chat, which is concrete evidence of SSRF against the metadata service rather than a blind request. The report also documented the limits honestly: no IAM role on the instance, no escalation to credentials, and JSON endpoints blocked by the curly-bracket restriction. That combination of a reproducible proof and a clear statement of what could not be achieved is what made the finding assessable.

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

What happened, in plain words

Streamlabs Cloudbot is a chatbot that streamers add to their live streams. Viewers type commands in the chat, and the bot answers with text the streamer has set up in advance. Those answers can contain placeholders, called variables, that the bot fills in when the command runs. One of those placeholders, readapi, tells the bot to fetch a web page and paste what it finds into the chat.

The researcher noticed that this fetch happens on Streamlabs' own computers, not on the viewer's. So by putting a web address into the readapi placeholder, a user could make a Streamlabs server visit a page of their choosing and read the result in chat. That is the essence of a vulnerability class called server-side request forgery, or SSRF: you trick a server into making a request on your behalf, to somewhere you could not reach yourself.

The interesting part is where the researcher pointed it. Cloud computing providers such as Amazon Web Services (AWS) give every virtual machine a special internal address, [redacted], that only the machine itself can reach. Asking that address questions is how a machine learns things about itself, such as its own name or its security settings. If an outsider can make the machine ask those questions and then read the answers, they learn things about the inside of the company's network.

There was a catch: the readapi feature only accepts addresses starting with https://, the secure form of a web address, and the internal AWS address only answers plain http://. The researcher got around this by hosting a small file on their own server that says "please go look over there instead", a redirect. The Streamlabs server followed the redirect, dropped from secure HTTPS to plain HTTP, and ended up talking to the internal AWS address. The answer came back into the stream chat.

What came back was a list of folder names from the machine's internal information page. It did not contain passwords or secret keys, because this particular machine had not been given any. The researcher was honest about that limit. Streamlabs fixed the problem by no longer following redirects. The report was rated medium severity, with a CVSS score of 5.0, and a bounty of 200.00 USD was paid. It was disclosed on 2021-02-24.

The product and the feature

Streamlabs Cloudbot is a customisable chatbot offered by Streamlabs. Stream viewers and streamers can create custom commands with custom response templates, and those templates can contain variables wrapped in curly brackets. The variables are documented at https://streamlabs.com/dashboard#/cloudbot/commands/variables. A simple example is {{user.name}}, which is replaced with the username of the viewer who executed the command in stream chat.

Think of a response template as a form letter with blanks. The streamer writes "Hello, ______, welcome back", and the bot fills in the blank with whoever typed the command. The blanks are the variables.

When a custom command runs, the Cloudbot backend takes the response template, translates each variable into its value, and sends the resulting text to the stream chat. The backend is the part of Streamlabs that runs on their servers, out of sight of the viewer. One of the available variables is readapi, written as {readapi.<url_here>}. To resolve it, the backend makes an HTTPS request to the supplied URL and substitutes the response body in place of the variable. For example:

  • The server's IP is {readapi.https://api.ipify.org} -> The server's IP is xx.xxx.xxx.x.

Here api.ipify.org is a simple public service that answers with the address of whoever asked. An API, short for application programming interface, is a web address designed to be read by a program rather than a person: you send a request, it sends back data. The bot asked ipify "what is your address?", and ipify answered with the address of the Streamlabs server that made the request. The bot then pasted that answer into the chat message.

The feature is therefore a server-side fetch of an attacker-influenced URL, with the result reflected back into a chat message the attacker can read. That is the shape of a server-side request forgery (SSRF) with response disclosure. "With response disclosure" simply means the attacker gets to see the answer, not just cause the request. Many SSRF bugs are blind: you can make the server knock on a door but you never hear what is behind it. Here the chat message is the window through which the answer comes back.

Setting up

The researcher hosted a redirect file on a server under their own control. No special role or privilege on the Streamlabs side is described.

Having your own server matters for this kind of test. You need a place you control where you can put a file and watch whether anyone visits it. It is like putting a note in your own letterbox and seeing whether the postman reads it.

The key precondition is that the readapi variable only accepts URLs using the https:// protocol. A protocol, also called a scheme, is the first part of a web address, the bit before the ://. It tells the browser or program how to talk: https:// means encrypted web traffic, http:// means unencrypted web traffic, ftp:// means file transfer, and so on. Any protocol other than HTTPS, including http://, is rejected by the backend, which replaces the variable with [Https required]:

  • The server's IP is {readapi.http://api.ipify.org} -> The server's IP is [Https required].

So the bot refuses to fetch a plain HTTP page. It prints a short error message in the chat instead, and the streamer and viewers see that message.

Because the AWS EC2 metadata service can only be reached over HTTP, this check appears to block the most obvious target. EC2 is Amazon's service for renting virtual machines, computers that run in Amazon's data centres. The metadata service is a special address inside each of those machines that answers questions about the machine itself. The rest of the work is about getting around the HTTPS-only rule.

Mapping the behaviour

The researcher mapped the behaviour of the readapi variable and found several caveats that constrain what can be read back through chat. These matter both for exploitation and for understanding why some payloads fail. A payload here just means the text you put into the command to try something.

  1. The response must have a common human-readable Content-Type. A missing Content-Type, or text/plain, text/html or application/json, returns the response in chat successfully. application/javascript, application/octet-stream or image/png cause [Invalid Content-Type] to be shown.
  2. The response code must be 2xx. 404 Not Found and 500 Internal Server Error pages are replaced with [Bad Server Response / Too slow] in chat.
  3. The timeout is very low, estimated at around 3000 ms. If the web server does not respond within that window, the connection is dropped and [Bad Server Response / Too slow] is shown. This makes it hard to distinguish an open, closed or filtered port when fingerprinting with SSRF port scanning against the backend server.
  4. There appears to be a content length limit. The exact value was not tested, but anything exceeding it returns nothing, so abc{readapi.https://superbigsite/}def -> abcdef.
  5. The response data cannot contain curly brackets { or }. The researcher believes this is because they represent variables. The backend recursively translates variables until none are left, so the restriction may exist to prevent infinite loops or at least a high number of requests. Response data containing those symbols returns nothing, the same behaviour as the previous point.

A few of those terms deserve unpacking.

Content-Type is a label that a web server attaches to its answer, saying what kind of thing it is sending: a web page, plain text, a picture, a program. Browsers use it to decide how to display the answer. The bot here only accepts labels that suggest ordinary readable text, and refuses things like images or program code.

The response code is the three-digit number every web server sends along with its answer. You have probably seen 404 when a page does not exist. Codes starting with 2 mean success, codes starting with 4 mean the thing asked for was not found or not allowed, and codes starting with 5 mean the server itself had a problem. The bot only passes on successful answers.

The timeout is how long the bot is willing to wait before giving up. Three thousand milliseconds is three seconds. That is short: a slow website will simply not answer in time, and the bot prints the error message instead.

A port is a numbered doorway on a computer. One machine can run many services, each listening on its own port. Port scanning means knocking on many doorways to see which ones answer. The researcher notes that the short timeout makes this unreliable here, because a closed door and a slow door look the same: both produce the same error message.

The HTTPS-only requirement is the obstacle for reaching the metadata service. The observation that unlocked the attack was that the Cloudbot backend follows redirects, even when the redirect target is an HTTP URL. A redirect is what happens when you visit a web address and the server answers "not here, go to this other address instead". Your browser then automatically loads the other address without asking you. That means an HTTPS URL the attacker controls can bounce the request to plain HTTP, and the protocol check is applied only to the URL supplied in the variable, not to the redirect destination.

In everyday terms: a bouncer checks your invitation at the front door, but once you are inside, nobody checks where you go next. The invitation said HTTPS, so the front door let it through. The redirect then walked it to an HTTP address.

Carrying out the attack

Step 1: Host an HTTPS redirector

The researcher hosted a file slpoc.php on their own server with the following contents:

PHP
<?php header('Location: http://[redacted]/latest/meta-data/'); ?>

Line by line:

  • <?php opens a block of PHP code. PHP is a programming language commonly used for web pages. The web server runs this code before sending anything back.
  • header('Location: http://[redacted]/latest/meta-data/'); tells the web server to send a Location header. A header is a small labelled line of information that travels with a web answer, alongside the actual content. The Location header is the standard way of saying "go to this address instead". The address given is http://[redacted]/latest/meta-data/, the internal AWS metadata page, over plain HTTP.
  • ?> closes the PHP block.

The script answers over HTTPS and issues a Location header pointing at the EC2 metadata service over HTTP. The backend follows it, so the request that actually reaches [redacted] is an HTTP request made by the Cloudbot server itself. The researcher's own server never touches the AWS address; it only tells the Streamlabs server where to go.

Step 2: Trigger the variable with a redirecting URL

The readapi variable was set to request the PHP file. The prefixing A and suffixing B are there to ensure a reply is visible even if the variable content is empty:

  • A{readapi.https://mydomain/slpoc.php}B -> Aami-id ami-launch-index ami-manifest-path block-device-mapping/ events/ hostname identity-credentials/ instance-action instance-id instance-type local-hostname local-ipv4 mac metrics/ network/ placement/ profile public-hostname public-ipv4 public-keys/ reservation-id security-groups services/B

Reading this in pieces: A is a plain letter the streamer typed. {readapi.https://mydomain/slpoc.php} is the variable, pointing at the redirect file on the researcher's server. B is another plain letter. If the variable came back empty, the chat would still show AB, so the researcher could tell the difference between "the feature ran and returned nothing" and "the feature did not run at all".

The response is the directory listing of /latest/meta-data/ from the EC2 instance running the Cloudbot backend, delivered into stream chat between the A and B markers. In other words, the internal page happened to be plain text and to answer successfully, which is exactly what the bot was willing to pass on.

The list of names, such as ami-id, hostname, local-ipv4 and security-groups, is the table of contents of the machine's own information. Each of those names is a page you could ask for next, if the bot would fetch it.

Step 3: Assessing how far it could go

The listing shows that the EC2 instance has no IAM role assigned to it. IAM stands for Identity and Access Management, Amazon's system for giving permissions to machines and people. A role is a set of permissions attached to a machine, and when a machine has one, the metadata service will hand out temporary credentials for it. Those credentials are the keys to the AWS account, and they are what an attacker would want next.

That limits the finding: without instance credentials, the researcher could not escalate to file disclosure, RCE or an AWS account takeover. File disclosure means reading files on the server that you should not see. RCE, remote code execution, means running your own programs on the server. An AWS account takeover means using stolen credentials to control the victim's cloud account. Cloudbot runs on multiple EC2 servers for load balancing, so there may be misconfigured servers that the researcher's Cloudbot was not running on and that would allow such escalation, but none were found. Load balancing means spreading incoming work across several machines so no single one is overwhelmed; which machine answers you is a matter of chance.

Step 4: Trying other protocols

Attempts to redirect to other protocols, such as gopher://, ftp://, file:// and dict://, all returned [Bad Server Response / Too slow] with nothing hitting the test servers. file:// would mean reading a file straight off the server's disk, ftp:// is an older file transfer protocol, and gopher:// and dict:// are older internet protocols that can sometimes be abused to send crafted data to other services. None of them worked. The request library used in the backend is therefore likely exclusively for web requests. A request library is the piece of software a program uses to make web requests; this one appears to speak only web traffic.

Step 5: The JSON limitation

Some AWS endpoints return JSON, such as http://[redacted]/latest/dynamic/instance-identity/document. JSON is a common text format for structured data, built out of curly brackets, square brackets, names and values. These endpoints cannot be retrieved because of caveat 5: the JSON contains curly brackets, and response data containing { or } returns nothing. This further limited the ability to obtain access keys, even if an IAM role had been attached. Access keys are the username-and-password equivalent for a program talking to a cloud service.

So even in the more dangerous case, where a machine had permissions worth stealing, the very format in which those permissions are delivered would have been swallowed by the bot's own variable handling.

Why it worked

The only protocol control is a check on the URL supplied in the variable: it must start with https://. The HTTP client, however, follows redirects, and the redirect target is not subjected to the same check. An attacker-controlled HTTPS endpoint can therefore redirect the backend to any HTTP URL, including the link-local metadata address [redacted].

Link-local is worth a sentence. Some addresses are defined to mean "this local network only" and are never routed across the internet. 169.254.x.x is one such range. It is how a machine talks to services that live inside itself, which is why the cloud metadata service sits there.

Exfiltrated means smuggled out; here, carried out through the chat message.

What it meant in practice

An attacker with a Cloudbot custom command could make the backend issue HTTP requests to hosts reachable from the Cloudbot servers and read the responses in stream chat. In this instance that exposed the EC2 instance metadata directory listing, confirming SSRF against the internal metadata service. The absence of an IAM role on the affected instance prevented escalation to credential theft, file disclosure, RCE or AWS account takeover. Because Cloudbot runs across multiple EC2 servers, other instances with an IAM role attached might have allowed further escalation, but the researcher did not find one. The JSON metadata endpoints that would carry identity documents and credentials were also blocked by the curly-bracket restriction.

CVSS is a standard scoring system for the seriousness of a security flaw; 5.0 sits in the middle of its range.

The fix

The applied fix stops the backend from following redirects. Redirects now produce [Bad Server Response / Too slow], which should prevent anyone from querying the AWS metadata endpoint, or any HTTP URL for that matter.

Going back to the bouncer comparison: now, if you are told to go to another address, the door is simply shut. The invitation is checked, and the trip ends there.

Similar things to look for elsewhere

These are the kinds of places where the same pattern can appear, and what a tester would try.

  • Redirect to link-local addresses. Host an HTTPS endpoint that returns a Location header to http://[redacted]/ and reference it through the variable. A positive result is metadata content appearing in the chat response.
  • Redirect to internal hostnames and RFC 1918 addresses. Point the redirect at internal services reachable from the backend. RFC 1918 addresses are the private address ranges used inside home and office networks, such as those starting 10. or 192.168.. A positive result is any response body from an internal host, subject to the content-type and status-code caveats.
  • Redirect chains. Use multiple hops, mixing schemes, to see whether validation is applied only to the first URL. A positive result is a final HTTP response returned through the variable.
  • Other protocol handlers via redirect. Try gopher://, ftp://, file:// and dict:// as redirect targets. In this report they all failed, but the same test on another target may reveal a client that supports more than web requests.
  • Content-type and status filtering. Serve responses with different Content-Type values and status codes to map exactly what the backend will reflect. A positive result is a body returned for a type or code the report lists as blocked.
  • Length and character limits. Probe the maximum reflected length and whether curly brackets can be smuggled through encoding. A positive result is a longer body or a body containing { or } reaching chat.

Notes for anyone hunting this kind of bug

This kind of bug tends to hide in user-facing templating and variable features that fetch remote content: chat bots, link previews, webhook testers, avatar or image importers, RSS and feed readers, and URL unfurlers. A webhook is a way for one service to notify another by sending it a request; a tester is a page that lets you try it out. An unfurler is the feature that turns a pasted link into a preview card. The signal during recon is a documented variable or parameter that takes a URL and whose output is shown back to the user. Recon means the early looking-around phase, before any attack. Read the documentation for the exact syntax and any stated protocol restrictions, then test whether those restrictions survive redirects.

A second signal is a protocol allowlist that only checks the initial URL. An allowlist is a list of things that are permitted, everything else being refused. Any feature that follows redirects is a candidate for a scheme or host bypass. Test with an HTTPS endpoint you control that redirects to HTTP, to link-local addresses, and to internal hosts, and watch for the reflected body.

The researcher showed enough impact by returning the EC2 metadata directory listing in chat, which is concrete evidence of SSRF against the metadata service rather than a blind request. The report also documented the limits honestly: no IAM role on the instance, no escalation to credentials, and JSON endpoints blocked by the curly-bracket restriction. That combination of a reproducible proof and a clear statement of what could not be achieved is what made the finding assessable.

Glossary

  • API: a web address or service designed to be read by a program rather than a person, sending back data instead of a web page.
  • Access keys: the credentials a program uses to talk to a cloud service, roughly a username and password for software.
  • Allowlist: a list of things that are allowed, with everything else refused.
  • AWS: Amazon Web Services, Amazon's cloud computing platform.
  • Blind SSRF: an SSRF where the attacker can make the server send a request but cannot see the answer.
  • Bounty: a payment made by a company to someone who reports a security flaw to it.
  • Content-Type: a label a web server attaches to its answer saying what kind of content it is, such as text, a web page or an image.
  • CVSS: a standard scoring system for how serious a security flaw is, from 0 to 10.
  • EC2: Amazon's service for renting virtual machines in its data centres.
  • Exfiltration: smuggling data out of a system.
  • File disclosure: reading files on a server that you are not supposed to see.
  • Header: a small labelled line of information sent alongside a web request or answer.
  • HTTPS: the encrypted form of web traffic, shown by https:// at the start of an address.
  • HTTP: the unencrypted form of web traffic, shown by http:// at the start of an address.
  • IAM role: a set of permissions attached to a machine or person in AWS; a machine with a role can be handed temporary credentials.
  • JSON: a common text format for structured data, built from curly brackets, square brackets, names and values.
  • Link-local address: an address in a range that only means something on the local machine or network and is never routed across the internet, such as 169.254.x.x.
  • Load balancing: spreading incoming work across several machines so no single one is overwhelmed.
  • Metadata service: a special internal address, [redacted] on AWS, that answers questions a machine asks about itself.
  • Payload: the text or data you send to try to trigger a behaviour.
  • PHP: a programming language commonly used to build web pages.
  • Port: a numbered doorway on a computer through which a particular service listens.
  • Port scanning: knocking on many ports to see which ones answer.
  • Protocol: the first part of a web address, before ://, that says how to talk, such as https:// or ftp://.
  • RCE (remote code execution): running your own programs on someone else's server.
  • Recon: the early looking-around phase of a security test, before any attack.
  • Redirect: a web answer that says "not here, go to this other address instead", which the client then follows automatically.
  • Request library: the piece of software a program uses to make web requests.
  • Response code: the three-digit number a web server sends with its answer, such as 200 for success or 404 for not found.
  • RFC 1918: the standard that defines the private address ranges used inside home and office networks.
  • Scheme: another word for protocol, the https part of https://.
  • Severity: how serious a security flaw is judged to be.
  • SSRF (server-side request forgery): tricking a server into making a request on your behalf, to somewhere you could not reach yourself.
  • Timeout: how long a program waits for an answer before giving up.
  • Variable: a placeholder in a text template that a program replaces with a value when the text is used.
  • Webhook: a way for one service to notify another by sending it a request.

More by nrockhouse

View all

1 more disclosed report, best first.

More from Logitech

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.