Unrestricted access to Eureka server on ██████
The Netflix Eureka server dashboard and REST API were accessible without authentication, allowing an attacker to view registered applications and potentially modify or register new instances. The reporter confirmed that a PUT request to the REST API returned 200, indicating write access was possible.
- Triaged in under an hour
- Fixed in 11 days
- Paid in 20 days
- Disclosed after 25 days
Hi Grab Security Team,
First of all, best wishes for 2018, empty of bugs if possible ;-)
Summary: I found that the following endpoint is hosting Netflix Eureka Server █████ and that even if some URLs are requiring authentication (401 code for some of thems like /metrics for example), it is still possible to send requests to the REST API.
Description: I think that this is a test infrastructure, however the dashboard some applications registered on Netflix Eureka server (please see screenshot attached "███") which targets private EC2 instance (nothing published on the Internet) are visible.
Digging a little bit shows that Netflix provides a REST API described here :
https://github.com/Netflix/eureka/wiki/Eureka-REST-operations
I tried some requests and it seems that it does not require any kind of authentication. I prefer to do some tests that could not lead to any disruption (even if this seems to be a test infrastructure), but for example the following request returns 200 :
PUT ████████HTTP/1.1
Host: ██████myteksi.net
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.9 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Connection: close
Upgrade-Insecure-Requests: 1
And the response is the following
HTTP/1.1 200
Date: Fri, 12 Jan 2018 09:17:36 GMT
Content-Type: application/xml
Content-Length: 0
Connection: close
Server: Tengine/2.2.1
Following the description of the REST API, I think that an attacker could modify any propertie regarding the current instances registered or even register a new one with his own settings. As I am not sure if there is some production behind, I choose to report it directly without doing any modification on the current systems.
Browsers Verified In:
N/A
Steps To Reproduce:
- Go to █████████ for the dashboard access (read only)
- Issue for example the above HTTP requestand check the server response (or any of the requests described in Netflix documentation)
Supporting Material/References:
- List any additional material (e.g. screenshots, video, logs, etc.)
Please let me know your thoughts,
Kind regards,
Reptou
Impact
From my perspective, this could help an attacker registers his custom AWS EC2 instance into an application and make it part of the service load balancing provided by Eureka.
Context
Grab runs a bug bounty programme on HackerOne, and the asset in scope here is *.myteksi.net. The researcher, reptou, found a Netflix Eureka Server exposed on a host inside that wildcard. Eureka is the service registry used by Spring Cloud and Netflix OSS: instances of an application register themselves with the server, and clients query it to discover where to send traffic. The server also exposes a dashboard and a REST API, and the REST API is what the researcher focused on.
The report was disclosed on 6 February 2018, rated medium severity under "Improper Access Control - Generic", and paid a 500 USD bounty.
Setup
No accounts, roles or special tooling are described. The researcher worked from the outside with a browser and a request tool, sending plain HTTP requests to the Eureka host. The only precondition was network reachability of the endpoint, which was on the public Internet even though the applications it listed were not.
Finding it
The researcher found that the endpoint was hosting a Netflix Eureka Server. Some URLs on it did require authentication: /metrics, for example, returned a 401. That partial protection is what made the finding interesting, because the REST API did not behave the same way. Requests to the REST API could be sent without any authentication.
The dashboard also listed applications registered on the Eureka server, and those applications targeted a private EC2 instance that was not published on the Internet. The researcher's reading was that this was probably a test infrastructure, but the registration data of private instances was still visible through it.
Exploitation
Step 1: Open the dashboard
The first reproduction step is simply to browse to the dashboard URL, which the researcher describes as read-only access. The dashboard is where the registered applications and their instances are listed, including the ones pointing at the private EC2 instance.
Step 2: Consult the REST API documentation
The researcher used Netflix's published description of the Eureka REST operations as the map of what the server accepts:
https://github.com/Netflix/eureka/wiki/Eureka-REST-operations
That documentation describes the operations for registering, deregistering and updating instances, among others. It is the reference the researcher followed when choosing requests to try.
Step 3: Send a request to the REST API
The researcher deliberately chose requests that could not disrupt anything, given the suspicion that this was test infrastructure. The example request below returned 200:
PUT ████████HTTP/1.1
Host: ██████myteksi.net
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.9 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Connection: close
Upgrade-Insecure-Requests: 1
The request line is a PUT to a path on the myteksi.net host, with no authentication header of any kind. The remaining headers are ordinary browser headers. The response was:
HTTP/1.1 200
Date: Fri, 12 Jan 2018 09:17:36 GMT
Content-Type: application/xml
Content-Length: 0
Connection: close
Server: Tengine/2.2.1
The request returned 200 with an empty XML body. The Server header identifies Tengine/2.2.1 as the front end. The researcher notes that any of the requests described in the Netflix documentation can be used the same way for verification.
Step 4: Stop before changing anything
Following the REST API description, the researcher concluded that an attacker could modify any property of the instances currently registered, or register a new instance with their own settings. Because it was not clear whether production sat behind this server, the researcher reported the issue without making any modification to the live systems.
Root cause
Access control on the Eureka host was applied unevenly. Some endpoints, such as /metrics, were protected and answered 401, but the REST API accepted unauthenticated requests, as the 200 response to the PUT shows.
Impact
In the researcher's view, an attacker could register a custom AWS EC2 instance into an application and make it part of the service load balancing provided by Eureka. The same API access would also allow modifying properties of instances already registered. The researcher hedges this: the infrastructure looked like a test environment, and it was not certain whether production sat behind it. The private EC2 instance itself was not reachable from the Internet; what leaked was its registration data through the dashboard and the API.
Fix
The report does not describe what was changed.
Variants to test
- Probe other management endpoints on the same host, such as
/metrics,/envor/health, and compare their status codes with the Eureka REST paths. A 401 on one and a 200 on another is the same inconsistency seen here. - Send a read-only Eureka REST request, for example a
GETfor the registry, and check whether the response lists instances with internal hostnames or private addresses. A positive result is registration data for hosts that are not publicly reachable. - Send a
PUTto an instance path with a body that changes nothing meaningful, and check for a 200 with an empty XML body as above. A positive result confirms write access without credentials. - Look for the same pattern on other Spring Cloud or Netflix OSS services exposed under wildcard scopes, where the dashboard is public but only some paths are protected.
Hunting notes
This kind of bug hides on hosts that expose a management or registry interface to the Internet while protecting only part of it. During recon, a Eureka dashboard that loads without a login is the signal; the next step is to compare status codes across the documented REST paths, because a 401 on one path says nothing about the others. The researcher demonstrated a 200 on an unauthenticated PUT and pointed at the private EC2 instance visible in the registry, while explicitly avoiding any modification.
What happened, in plain words
Grab, the company behind the ride-hailing app, runs a bug bounty programme on HackerOne. A bug bounty programme is a deal: a company says "if you find a security problem in our systems and tell us privately, we will pay you a reward instead of getting angry". The reward is called a bounty. The researcher in this report, reptou, was allowed to look at any host whose name ends in *.myteksi.net (the star means "anything before this part").
On one of those hosts, the researcher found a piece of software called Netflix Eureka Server running and reachable from the public Internet. Eureka is a kind of address book for a company's internal services. Imagine a large office building where every department needs to phone the others. Instead of memorising every extension, each department registers its number in a central directory, and anyone who needs to call a department looks the number up there. Eureka does exactly that for software: each copy of an application (an "instance") registers itself with the Eureka server, and other programs ask the server "where do I send my traffic?".
Eureka offers two ways to look at this directory: a web dashboard you can open in a browser, and a REST API. An API (Application Programming Interface) is a way for programs to talk to each other over the network, usually by sending requests to specific addresses (URLs) and getting structured answers back. A REST API is a common style of API where each URL represents a thing (an instance, a list of instances) and the type of request says what to do with it: GET means "read", PUT means "create or replace", DELETE means "remove".
The problem was that the REST API could be used without logging in, even though some other parts of the same server did ask for a login. The researcher showed this with a harmless request that the server accepted. The report was disclosed on 6 February 2018, rated medium severity under the category "Improper Access Control - Generic", and paid a 500 USD bounty.
Setup
The report describes no accounts, no special roles and no special tools. The researcher worked from the outside, with a browser and something to send HTTP requests with. HTTP is the language browsers and servers speak: you send a request (a method such as GET or PUT, a path, some headers) and the server sends back a response (a status code such as 200 or 401, some headers, sometimes a body).
The only precondition was that the Eureka host could be reached over the Internet. That is worth pausing on: the applications listed inside Eureka were not reachable from the Internet, but the directory that described them was.
Finding it
The researcher found that the endpoint was hosting a Netflix Eureka Server. An endpoint here just means a URL on a server that answers requests. Some URLs on that server did require authentication: /metrics, for example, returned a 401. A 401 is the HTTP status code for "you are not authorised, identify yourself first". That partial protection is what made the finding interesting: the REST API did not behave the same way, and requests to it could be sent without any authentication at all.
The dashboard also listed applications registered on the Eureka server, and those applications targeted a private EC2 instance. EC2 is Amazon's service for renting virtual computers in the cloud, and "private" means that computer had no address reachable from the Internet. The researcher's reading was that this was probably a test infrastructure, but the registration data of private instances was still visible through it. In other words, the directory was public even though the things it listed were not.
Exploitation
Step 1: Open the dashboard
The first reproduction step is simply to browse to the dashboard URL, which the researcher describes as read-only access. Read-only means you can look but the page does not let you change anything. The dashboard is where the registered applications and their instances are listed, including the ones pointing at the private EC2 instance. Opening it in a browser was enough to see that data.
Step 2: Consult the REST API documentation
The researcher used Netflix's published description of the Eureka REST operations as the map of what the server accepts:
https://github.com/Netflix/eureka/wiki/Eureka-REST-operations
This is a link to a documentation page, not a request against Grab. It lists the operations the Eureka API supports: registering an instance, removing an instance, updating an instance, and so on. Reading the documentation first is the sensible order of work, because it tells you which URLs exist and what each one does, so you can pick a request that proves the point without breaking anything. It is the reference the researcher followed when choosing requests to try.
Step 3: Send a request to the REST API
The researcher deliberately chose requests that could not disrupt anything, given the suspicion that this was test infrastructure. The example request below returned 200:
PUT ████████HTTP/1.1
Host: ██████myteksi.net
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.9 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Connection: close
Upgrade-Insecure-Requests: 1
Line by line:
PUT ████████HTTP/1.1is the request line.PUTis the method, meaning "create or replace this thing". The path is redacted in the report, andHTTP/1.1is the version of the protocol being used. The path is the part that tells the server which operation you want, and the documentation from step 2 is what tells you which paths exist.Host: ██████myteksi.netnames the server you are talking to. One physical server can host many names, so the request has to say which one it wants. The part beforemyteksi.netis redacted.User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.9 Safari/537.36is the header a browser uses to introduce itself. It says "I am Chrome 62 on 64-bit Windows 10". It is the header a browser uses to introduce itself.Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8tells the server which response formats the client will accept, and roughly in what order of preference. Theq=numbers are weights: higher means preferred.Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3says the client prefers French, then American English, then English generally. Again theq=values rank the choices.Connection: closeasks the server to close the network connection after this one response, rather than keeping it open for more requests.Upgrade-Insecure-Requests: 1is a browser header meaning "if this page has an insecure version, please send me the secure one instead".
The important thing to notice is what is missing: there is no Authorization header, no session cookie, no token. A cookie is a small piece of data a site stores in your browser after you log in, and the browser sends it back with each request so the server knows who you are. A token is a similar proof of identity, usually a long string sent in a header. Neither is present here, so the server had no way to know who was asking, and it answered anyway.
The response was:
HTTP/1.1 200
Date: Fri, 12 Jan 2018 09:17:36 GMT
Content-Type: application/xml
Content-Length: 0
Connection: close
Server: Tengine/2.2.1
Line by line:
HTTP/1.1 200is the status line. 200 means "OK, done". Compare that with the 401 seen on/metrics: same server, different answer, because the two paths were protected differently.Date: Fri, 12 Jan 2018 09:17:36 GMTis when the server produced the response.Content-Type: application/xmlsays the body is XML, a text format for structured data that uses tags in angle brackets.Content-Length: 0says the body is empty. So the server accepted the operation and had nothing to say back.Connection: closeconfirms the connection will be closed after this response.Server: Tengine/2.2.1identifies the web server software in front of the application. Tengine is a web server built on nginx, a very common piece of software that sits in front of applications and forwards requests to them.
The request returned 200 with an empty XML body. The researcher notes that any of the requests described in the Netflix documentation can be used the same way for verification, so this one request is an example rather than the only possibility.
Step 4: Stop before changing anything
Following the REST API description, the researcher concluded that an attacker could modify any property of the instances currently registered, or register a new instance with their own settings. Because it was not clear whether production sat behind this server, the researcher reported the issue without making any modification to the live systems. This restraint matters: proving that a door opens is enough, you do not have to walk through it and rearrange the furniture.
Root cause
Access control on the Eureka host was applied unevenly. Access control is the part of a system that decides who is allowed to do what. Some endpoints, such as /metrics, were protected and answered 401, but the REST API accepted unauthenticated requests, as the 200 response to the PUT shows. A useful comparison is a building where the front door has a lock but the side entrance does not: the lock exists, it is just not on every way in.
Impact
In the researcher's view, an attacker could register a custom AWS EC2 instance into an application and make it part of the service load balancing provided by Eureka. Load balancing is how traffic is spread across several copies of a service; if an attacker can add their own machine to that list, some real traffic may be sent to it. The same API access would also allow modifying properties of instances already registered. The researcher hedges this: the infrastructure looked like a test environment, and it was not certain whether production sat behind it. The private EC2 instance itself was not reachable from the Internet; what leaked was its registration data through the dashboard and the API.
Fix
The report does not describe what was changed.
Variants to test
- Probe other management endpoints on the same host, such as
/metrics,/envor/health, and compare their status codes with the Eureka REST paths. A 401 on one and a 200 on another is the same inconsistency seen here. - Send a read-only Eureka REST request, for example a
GETfor the registry, and check whether the response lists instances with internal hostnames or private addresses. A positive result is registration data for hosts that are not publicly reachable. - Send a
PUTto an instance path with a body that changes nothing meaningful, and check for a 200 with an empty XML body as above. A positive result confirms write access without credentials. - Look for the same pattern on other Spring Cloud or Netflix OSS services exposed under wildcard scopes, where the dashboard is public but only some paths are protected.
Hunting notes
This kind of bug hides on hosts that expose a management or registry interface to the Internet while protecting only part of it. During recon, a Eureka dashboard that loads without a login is the signal; the next step is to compare status codes across the documented REST paths, because a 401 on one path says nothing about the others. The researcher demonstrated a 200 on an unauthenticated PUT and pointed at the private EC2 instance visible in the registry, while explicitly avoiding any modification.
Glossary
- API: a defined way for programs to talk to each other over a network, usually a set of URLs and rules for what to send and what comes back.
- Access control: the part of a system that decides who is allowed to do what.
- Authentication: proving who you are, usually with a password, cookie or token.
- Authorization header: an HTTP header used to carry proof of identity with a request.
- Bounty: a reward paid by a company for a valid security report.
- Bug bounty programme: a scheme where a company invites researchers to report security problems privately in exchange for a reward.
- Cookie: a small piece of data a site stores in your browser and the browser sends back with later requests, often used to remember that you logged in.
- Dashboard: a web page that displays information, here the list of registered applications and instances.
- EC2: Amazon's service for renting virtual computers in the cloud.
- Endpoint: a URL on a server that answers requests.
- Eureka: Netflix's service registry, an address book where applications register themselves and others look them up.
- Header: an extra line of information sent with an HTTP request or response, such as the browser name or the content type.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- Instance: one running copy of an application, which registers itself with Eureka.
- Load balancing: spreading incoming traffic across several copies of a service.
- Method: the verb of an HTTP request, such as
GET(read),PUT(create or replace) orDELETE(remove). - Netflix OSS: Netflix's collection of open-source tools for building distributed systems, which includes Eureka.
- Private address: a network address that is only reachable inside an organisation's network, not from the Internet.
- REST API: an API style where each URL represents a thing and the HTTP method says what to do with it.
- Service registry: a directory where running services record where they can be reached, so others can find them.
- Spring Cloud: a set of tools for building applications in Java that commonly uses Eureka as its service registry.
- Status code: the three-digit number in an HTTP response saying how it went, such as 200 (OK) or 401 (not authorised).
- Tengine: a web server built on nginx that sits in front of applications and forwards requests to them.
- Token: a string used as proof of identity, usually sent in a header.
- XML: a text format for structured data that uses tags in angle brackets.
- 401: the HTTP status code meaning the request needs authentication and none (or invalid) credentials were supplied.