Skip to content
SSRF Write-up Intermediate

Yahoo Small Business (Luminate) and the Not-So-Secret Keys

A screenshot service fetched any URL supplied by the user, including the AWS instance metadata endpoint, and returned the response as an image. An attacker could read the EC2 instance's IAM role credentials and use them to access AWS resources.

Tommy DeVoss Follow

Published on dos.sh

Bounty$9,000 View original

It's been awhile since I have written up any of the bugs I have found during my normal bug hunting, and this will be my first post for our company’s new blog. For those that do not know me, my name is Tommy, and I go by the alias “dawgyg”.

Tommy DeVoss / dawgyg (@thedawgyg), on dos.sh

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

Context

Yahoo's Luminate Small Business platform let users list local businesses, create and host websites on Yahoo servers, build stores and shops, and buy things such as domains. The feature at the centre of this write-up is a site snapshot tool: a page that takes a URL and returns an image of that page. It lives at a single endpoint and takes a single parameter.

HTTP
https://webshots.luminate.com/tools/site/snapshot/desktop

The only parameter is url. Navigating to the page returns content with a JPEG content type, and the URL supplied in url is the page that appears "featured" in the returned image. In normal use that means a user's own site is rendered into a thumbnail.

Setup

The work was done as a two-person bug bounty effort against Yahoo and its various entities, properties and acquisitions. The author, Tommy ("dawgyg"), is a Unix system admin, DevOps engineer and hacker, and hunts bugs in his spare time. His collaborator on this target was @zlz.

After looking at the free portions of the Luminate sites, the pair decided to buy accounts so they had access to more functionality to test. The author created an account to sell things online; @zlz signed up for an account that included web hosting. No special tooling is described beyond the accounts and a private Slack channel on the Bug Bounty Forum used to share findings.

Finding it

During his checkout process, @zlz noticed an image being loaded on one of his pages. It appeared to be a picture of one of the Luminate pages the pair had already been testing. He copied the link to the image, pasted it into the private Slack chat and described what it was doing.

The endpoint behind that image was the snapshot tool above. Two things stood out. First, the response carried a JPEG content type. Second, the URL passed in the url parameter was the page rendered into the image. That made the parameter an input to a server-side fetch: the server was retrieving a URL chosen by the caller and returning a rendering of it.

At the same time the author was already stuck on a different blind SSRF he had found with help from @jobert, and had not managed to exploit it meaningfully. With no progress on that one, he turned to @zlz's endpoint.

Over the next hour or two the pair tried to make the endpoint load various local IP addresses. All of them appeared to be blocked, including localhost. They also tried loading remote SVG images in the hope of XSS, with no success. Inspecting the requests sent to the remote server named in url, they concluded the endpoint made a simple GET request to the supplied URL and took a screenshot of the page. They called it a night: @zlz had work in the morning and the author was travelling to Washington DC for the annual AWS Public Sector Summit.

Exploitation

Step 1: A talk provides the missing address

At the summit, the author sat in on a talk titled "Securing Your AWS Account". He generally does not pay attention to conference talks, but this time he listened for a couple of minutes after the introduction. The speaker mentioned the AWS metadata IP address that EC2 instances can reach, and the address appeared on screen. It looked familiar. Checking the private chat with @jobert from the night before, he saw it was the same address @jobert had been helping him test against for the other blind SSRF.

Step 2: Reach the metadata service

On a whim he plugged the address and part of a path into the snapshot endpoint:

Text
http://[redacted]/latest/meta-data/

The server fetched that URL and returned an image. The local-address blocking that had stopped localhost and the other local IPs the night before did not stop the link-local metadata address.

Step 3: Enumerate IAM roles

He changed the URL to the credentials path:

Text
http://[redacted]/latest/meta-data/iam/security-credentials/

The response showed that an IAM role existed, called Ec2LeastPrivileged.

Step 4: Read the credentials

One more path change, appending the role name:

Text
http://[redacted]/latest/meta-data/iam/security-credentials/Ec2LeastPrivileged

The endpoint returned a response for that path. At that point the author stopped all testing and filed the report to Yahoo through HackerOne.

Root cause

The snapshot feature fetched the URL supplied in the url parameter from the server side and rendered the result; the filtering in place did not cover the link-local metadata address. The filtering that blocked localhost and the other local addresses tried the night before did not cover [redacted], so the request reached the EC2 instance metadata service. Because the instance ran with an IAM role attached, the metadata service exposed that role's name and then its credentials to anyone who could make the server issue the request. The report does not describe the filtering implementation, so the exact reason the metadata address slipped through is not stated.

Impact

A caller of the snapshot endpoint could make Yahoo's server fetch the EC2 metadata service and disclose the IAM credentials of the Ec2LeastPrivileged role. What those credentials allowed is not described in the report. The author notes the role's name suggests least privilege, but the exposure is still of live secret keys belonging to Yahoo infrastructure.

Fix

Yahoo triaged the issue within an hour of the report, took the endpoint down and revoked the compromised secret keys less than an hour later. The HackerOne report was marked resolved at 2:47pm Eastern Time on 13 June 2017, roughly an hour after submission. The author credits @junot and @ftsqrl from the Yahoo Paranoids for the speed of the response. The report does not describe any code change beyond taking the endpoint down and rotating the keys.

Variants to test

  1. Other link-local and metadata addresses. Try the same url parameter with the metadata address of other cloud providers, and with IPv4 and IPv6 forms of the link-local range. A positive result is a rendered page showing instance metadata rather than an error or a blank image.
  2. Redirects to the metadata service. Point url at a host you control that issues a redirect to [redacted]. If the fetcher follows redirects after its address check, the metadata listing comes back in the image.
  3. DNS rebinding. Use a hostname that resolves to a permitted address on the first lookup and to the metadata address on the second. A positive result is metadata content in the response.
  4. Alternate encodings of the address. Try decimal, octal or mixed representations of [redacted]. If the filter matches the string rather than the resolved address, one of these may pass and still reach the metadata service.
  5. Credential paths beyond the role name. Once a role name is visible, request the credentials path for that role and check whether the response contains access keys. A positive result is a JSON document with key material rather than an error.
  6. Other server-side fetchers on the same estate. Look for screenshot, thumbnail, preview, import-from-URL and webhook features that take a URL. A positive result is any of them returning content fetched from an address the caller should not be able to reach.

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

What happened, in plain words

A security researcher and a friend were testing Yahoo's small-business website builder, a product called Luminate. One of its features takes a web address you give it and returns a picture of that web page, like a thumbnail. The researchers discovered that the server doing the screenshotting would fetch a special internal address that only machines inside Yahoo's cloud can normally reach. That internal address hands out secret login credentials to the machine that asks. By pointing the screenshot tool at it, they made Yahoo's own server fetch its own metadata, including the IAM role and its credentials path. They reported it, Yahoo took the endpoint down within about an hour, and on 29 June they were paid 9,000 US dollars.

This write-up walks through the whole story from zero. You only need to know how to use a browser to follow it.

Background: what Luminate is and what the snapshot tool does

Yahoo's Luminate Small Business platform let people list local businesses, create and host websites on Yahoo's servers, build online stores and shops, and buy things such as domain names. Think of it as a website builder plus hosting plus a shop, all in one.

The feature at the centre of this story is a site snapshot tool. A snapshot is just a picture of a web page, the same thing you would get if you pressed the screenshot key on your computer while a page was open. The tool lives at one web address, called an endpoint. An endpoint is simply a specific URL that a program (or a person) can send a request to, and that does one particular job.

HTTP
https://webshots.luminate.com/tools/site/snapshot/desktop

Line by line:

  • https:// means the connection is encrypted, the same padlock you see in your browser's address bar.
  • webshots.luminate.com is the name of the server that runs the snapshot tool.
  • /tools/site/snapshot/desktop is the path on that server, telling it which feature you want: the desktop version of a site snapshot.

The tool takes a single input, called a parameter. A parameter is a named value you attach to a URL, usually after a question mark, like ?url=.... Here the only parameter is url. You give it a web address, and the server goes and fetches that address and turns the page into an image. The page you named in url is the one that appears "featured" in the returned picture. In normal, intended use, a customer types in their own website's address and gets a nice thumbnail of their own site.

That is the whole feature. Simple, useful, and, as it turned out, dangerous.

Setting the scene: who was testing and how

The work was a two-person bug bounty effort. A bug bounty is a programme where a company pays independent researchers to find security problems in its systems and report them privately instead of exploiting them. The target here was Yahoo and its various entities, properties and acquisitions, meaning Yahoo itself plus all the other companies and products it had bought over the years.

The author, Tommy (known online as "dawgyg"), is a Unix system administrator, a DevOps engineer and a hacker, and he hunts bugs in his spare time. His collaborator on this target was @zlz.

After looking at the free portions of the Luminate sites, the pair decided to buy accounts so they would have access to more functionality to test. Paid accounts unlock extra features, and extra features mean more surface area to poke at. The author created an account to sell things online; @zlz signed up for an account that included web hosting. No special tooling is described beyond those accounts and a private Slack channel on the Bug Bounty Forum, which the two used to share findings with each other.

Finding it: an image that looked suspicious

During his checkout process, @zlz noticed an image being loaded on one of his pages. It appeared to be a picture of one of the Luminate pages the pair had already been testing. That is odd: why would a checkout page load a picture of another page? He copied the link to the image, pasted it into the private Slack chat and described what it was doing.

The endpoint behind that image was the snapshot tool shown above. Two things stood out to the researchers.

  1. The response carried a JPEG content type. A content type is a label the server attaches to its reply telling the browser what kind of thing it is sending: an image, a web page, a file, and so on. JPEG is a common image format. So the server was saying "here is a picture".
  2. The URL passed in the url parameter was the page rendered into that picture. In other words, the server was taking an address chosen by whoever called it, going out to the internet to fetch that address, and returning a picture of the result.

That second point is the important one. The server is making a request on your behalf. When a server fetches a URL that a user supplied, security people call it a server-side request. If an attacker can make the server fetch addresses it should not be able to reach, that is a vulnerability class called Server-Side Request Forgery, or SSRF. "Forgery" because the attacker is forging a request that looks like it came from the server itself, and the server is trusted by things around it in a way an outside visitor is not.

A useful everyday comparison: imagine a receptionist who will, on request, phone any number you write on a slip of paper and read you back what the person on the other end says. Normally you ask them to call a shop and read you the opening hours. But if you write down the number of the company's own internal safe-room, the receptionist will call it, because they are inside the building and trusted, and read you back whatever the safe-room says. You never had to get past the front door yourself.

At the same time, the author was already stuck on a different blind SSRF he had found with help from @jobert. Blind here means the attacker cannot see the response directly; they can only infer what happened from side effects. He had not managed to exploit that one in any meaningful way. With no progress there, he turned his attention to @zlz's endpoint.

Over the next hour or two the pair tried to make the snapshot endpoint load various local IP addresses. An IP address is the numeric address of a machine on a network, like a postal address for computers. "Local" addresses are ones that only make sense inside a private network, such as [redacted] (which always means "this very machine") or addresses in the 192.168.x.x and 10.x.x.x ranges used inside homes and offices. If the server could be made to fetch those, it might reach internal services that are not exposed to the internet. All of them appeared to be blocked, including localhost. Localhost is the name for "this machine itself"; when a server fetches localhost, it is talking to itself.

They also tried loading remote SVG images in the hope of XSS. SVG is a picture format that can contain code, and XSS (Cross-Site Scripting) is a class of bug where an attacker gets their own code to run inside someone else's web page, in that page's context. That attempt failed too.

By inspecting the requests sent to the remote server named in url, they concluded the endpoint made a simple GET request to the supplied URL and took a screenshot of the page. A GET request is the most basic kind of web request: "please give me the thing at this address". It is what your browser sends every time you type a URL and press Enter. So the tool was: take the URL, ask that server for the page, render it, return a picture. Nothing more.

Stumped, they called it a night. @zlz had work in the morning, and the author was travelling to Washington DC for the annual AWS Public Sector Summit.

Exploitation: how the bug was actually used

Step 1: A conference talk provides the missing address

At the summit, the author sat in on a talk titled "Securing Your AWS Account". AWS stands for Amazon Web Services: Amazon's cloud platform, where companies rent computers (called instances) and storage over the internet instead of buying physical machines. Yahoo, like many companies, ran parts of its infrastructure on AWS.

The author generally does not pay attention to conference talks, but this time he listened for a couple of minutes after the introduction. The speaker mentioned the AWS metadata IP address that EC2 instances can reach. EC2 is Amazon's service for renting virtual servers. The metadata service is a small helper that runs on every EC2 instance and answers questions about the instance itself: what its name is, what network it is on, and, crucially, what permissions it has been given. It lives at a fixed, special address: [redacted].

That address is a link-local address. Link-local addresses are a special range that a machine can only reach on its own local network segment, never across the public internet. Think of it as an intercom inside a building: you can only use it if you are already inside. The metadata service is deliberately reachable only from the instance itself, because it hands out sensitive information.

The address appeared on the big screen. It looked familiar. Checking the private chat with @jobert from the night before, he saw it was the same address @jobert had been helping him test against for the other blind SSRF. That earlier, unsuccessful work had at least taught him what the address was and what it did.

Step 2: Reach the metadata service

On a whim, he plugged the address and part of a path into the snapshot endpoint:

Text
http://[redacted]/latest/meta-data/

Line by line:

  • http:// is the unencrypted web protocol. The metadata service speaks plain HTTP.
  • [redacted] is the fixed link-local address of the metadata service on every EC2 instance.
  • /latest/meta-data/ is the path that asks for the general listing of metadata: the top-level menu of what the service knows about this machine.

The server fetched that URL and returned an image. This is the moment the bug became real. The local-address blocking that had stopped localhost and the other local IPs the night before did not stop the link-local metadata address. The filter, whatever it was, had a gap.

Why did this matter? Because the server doing the fetching was an EC2 instance inside Yahoo's cloud. When it asked the metadata service "who are you?", the service answered, and the answer came back to the researchers as a picture.

Step 3: Enumerate IAM roles

He changed the URL to the credentials path:

Text
http://[redacted]/latest/meta-data/iam/security-credentials/

Line by line:

  • http://[redacted] is the same metadata service as before.
  • /latest/meta-data/ is the same metadata menu.
  • /iam/security-credentials/ is a specific sub-path that asks: "which security credentials does this machine have?"

IAM stands for Identity and Access Management. It is AWS's system for deciding who is allowed to do what. An IAM role is a named set of permissions that can be attached to a machine, so the machine can act with those permissions without anyone typing in a password. When an EC2 instance has a role attached, the metadata service will tell anyone who asks what that role is called, and then hand out temporary credentials for it.

The response showed that an IAM role existed, called Ec2LeastPrivileged. The name suggests the role was intended to have as few permissions as possible, a principle called least privilege: give something only the access it strictly needs, nothing more. That is good practice, but it does not make the credentials harmless. Even a low-privilege key is a real key.

Step 4: Read the credentials

One more path change, appending the role name:

Text
http://[redacted]/latest/meta-data/iam/security-credentials/Ec2LeastPrivileged

Line by line:

  • Everything up to /iam/security-credentials/ is the same as before.
  • Ec2LeastPrivileged at the end is the name of the role discovered in the previous step. Asking for the credentials path with the role name appended is how you request the actual keys for that role.

The endpoint returned a response for that path. Credentials here means the secret material AWS uses to prove identity: typically an access key ID and a secret access key, plus a session token. Think of the access key ID as a username and the secret access key as a password, except they are long random strings meant for machines, not people. Anyone holding them can act as that role, within whatever permissions the role has.

At that point the author stopped all testing and filed the report to Yahoo through HackerOne. HackerOne is a platform where bug bounty reports are submitted, triaged and tracked. Stopping immediately is the right move: once you have live credentials, continuing to poke around risks causing damage or losing the evidence trail.

Why it worked: the root cause

The snapshot feature fetched the URL supplied in the url parameter from the server side and rendered the result; the filtering in place did not cover the link-local metadata address. The filtering that blocked localhost and the other local addresses tried the night before did not cover [redacted], so the request reached the EC2 instance metadata service.

Because the instance ran with an IAM role attached, the metadata service exposed that role's name and then its credentials to anyone who could make the server issue the request. The report does not describe the filtering implementation, so the exact reason the metadata address slipped through is not stated.

In plain terms: the receptionist was told "do not call any internal numbers", but the list of internal numbers they were given was incomplete. The metadata address was not on it, so the call went through.

Impact: what an attacker could have done

A caller of the snapshot endpoint could make Yahoo's server fetch the EC2 metadata service and disclose the IAM credentials of the Ec2LeastPrivileged role. Unauthenticated means the attacker did not need to log in or have an account; anyone who could reach the endpoint could do it.

What those credentials allowed is not described in the report. The author notes the role's name suggests least privilege, but the exposure is still of live secret keys belonging to Yahoo infrastructure. Live keys are dangerous because they work right now, until someone revokes them, and they can be used from anywhere in the world.

The fix and the timeline

Yahoo triaged the issue within an hour of the report, took the endpoint down and revoked the compromised secret keys less than an hour later. Triaged means the security team looked at the report, confirmed it was real and assigned it to be fixed. Revoked means the keys were cancelled so they no longer work, like changing the locks after losing your keys.

The HackerOne report was marked resolved at 2:47pm Eastern Time on 13 June 2017, roughly an hour after submission. The author credits @junot and @ftsqrl from the Yahoo Paranoids for the speed of the response. The Yahoo Paranoids is Yahoo's internal security team. The report does not describe any code change beyond taking the endpoint down and rotating the keys. Rotating keys means replacing old ones with new ones.

Here is the timeline as given:

Date and time Event
06-12-2017 Initial discovery by @zlz, unable to exploit
06-13-2017 1:30pm Eastern Time Successful exploitation, compromising the IAM Secret Keys
06-13-2017 1:44pm Eastern Time Report submitted to Yahoo! via HackerOne
06-13-2017 2:47pm Eastern Time Endpoint taken down, keys rotated, HackerOne report marked as Resolved
06-29-2017 Yahoo awards bounty of 9,000 US dollars

Variants to test: how to look for the same bug elsewhere

If you are learning to hunt for this kind of bug, here are angles worth trying. Each one is a way of getting past a filter that is meant to stop the server from fetching internal addresses.

  1. Other link-local and metadata addresses. Try the same url parameter with the metadata address of other cloud providers, and with IPv4 and IPv6 forms of the link-local range. A positive result is a rendered page showing instance metadata rather than an error or a blank image. Different clouds use different addresses, so a filter written for one may miss another.
  2. Redirects to the metadata service. Point url at a host you control that issues a redirect to [redacted]. A redirect is when a server says "I do not have that, go ask this other address instead". If the fetcher follows redirects after its address check, the metadata listing comes back in the image. The check happens on the first address, but the fetch ends up somewhere else.
  3. DNS rebinding. Use a hostname that resolves to a permitted address on the first lookup and to the metadata address on the second. DNS is the system that turns names like example.com into IP addresses. Rebinding means changing the answer between the check and the actual fetch, so the filter sees a safe address and the server connects to a dangerous one.
  4. Alternate encodings of the address. Try decimal, octal or mixed representations of [redacted]. If the filter matches the string rather than the resolved address, one of these may pass and still reach the metadata service. Computers can write the same number in several ways, and a filter that only looks for one spelling will miss the others.
  5. Credential paths beyond the role name. Once a role name is visible, request the credentials path for that role and check whether the response contains access keys. A positive result is a JSON document with key material rather than an error. JSON is a common text format for structured data, the kind of thing a machine reads rather than a person.
  6. Other server-side fetchers on the same estate. Look for screenshot, thumbnail, preview, import-from-URL and webhook features that take a URL. A webhook is a URL that one system calls automatically when something happens. A positive result is any of them returning content fetched from an address the caller should not be able to reach. The bug is not really about screenshots; it is about any feature where the server fetches a URL on your behalf.

Glossary

  • API: a defined way for one program to talk to another, like a menu of requests a service will answer.
  • AWS: Amazon Web Services, Amazon's cloud platform for renting computers and storage over the internet.
  • Blind SSRF: a server-side request forgery where the attacker cannot see the response directly and must infer what happened from side effects.
  • Bug bounty: a programme where a company pays independent researchers to find and privately report security problems.
  • Content type: a label on a server's reply saying what kind of thing it is sending, such as an image or a web page.
  • Credentials: secret material that proves identity, such as an access key ID and secret access key.
  • DNS: the system that turns names like example.com into IP addresses.
  • DNS rebinding: changing a hostname's answer between a security check and the actual connection, so the check sees a safe address and the connection goes to a dangerous one.
  • EC2: Amazon's service for renting virtual servers in the cloud.
  • Endpoint: a specific URL that does one particular job.
  • GET request: the most basic web request, meaning "please give me the thing at this address".
  • HackerOne: a platform where bug bounty reports are submitted, triaged and tracked.
  • IAM: Identity and Access Management, AWS's system for deciding who is allowed to do what.
  • IAM role: a named set of permissions that can be attached to a machine so it can act with those permissions without a password.
  • Instance: a virtual computer rented in a cloud.
  • IP address: the numeric address of a machine on a network.
  • JPEG: a common image file format.
  • JSON: a common text format for structured data that machines read.
  • Least privilege: the principle of giving something only the access it strictly needs.
  • Link-local address: a special address range reachable only on the local network segment, never across the public internet.
  • Localhost: the name for "this machine itself".
  • Metadata service: a helper on a cloud instance that answers questions about the instance, including its credentials, at a fixed link-local address.
  • Parameter: a named value attached to a URL, usually after a question mark.
  • Redirect: when a server tells the client to go and ask a different address instead.
  • Revoked: cancelled so that a key or credential no longer works.
  • Rotating keys: replacing old keys with new ones.
  • Server-side request: a request made by a server on behalf of a user, rather than by the user's own browser.
  • Snapshot: a picture of a web page, like a screenshot.
  • SSRF (Server-Side Request Forgery): a vulnerability where an attacker can make a server fetch addresses it should not be able to reach.
  • SVG: an image format that can contain code.
  • Triaged: reviewed and confirmed as a real issue by a security team.
  • Unauthenticated: not requiring a login or account.
  • Webhook: a URL that one system calls automatically when something happens.
  • XSS (Cross-Site Scripting): a bug where an attacker gets their own code to run inside someone else's web page.

More from Yahoo! / Verizon Media

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.