question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[⭐] Exposed Prometheus Metrics Endpoint

See original GitHub issue

⭐ Challenge idea

Description

Modern services often expose metrics about the current state of the service / server on a /metrics endpoint. This endpoint is then scraped by systems like prometheus to gather these metrics over time.

These metrics endpoint is not really intended for β€œnormal” users. Yet prometheus security model explicitly states that is is expected that untrusted users should be able to access the metrics data, see https://prometheus.io/docs/operating/security/#prometheus. In the security review performed by the CNCF this was mentioned but later decided to ignore as expected behavior by prometheus team. (See https://prometheus.io/assets/downloads/2018-06-11--cure53_security_audit.pdf PRM-01-002: Clients leak Metrics data thought unprotected endpoints)

Normal setups try not to expose approaches include routing the /metrics endpoint to a 404 page via a loadbalancer / reverse proxy sitting in front of the application. Or protect the endpoint using http basic auth.

The Juice Shop could have its own /metrics endpoint exposing Juice Shop related metrics to the instance, obviously exposed via any auth / protection.

  • Orders completed
  • Juices sold
  • Users signed up
  • Challenges solved

Adding this challenge would also mean that one could use prometheus / grafana to monitor all their Juice Shop instances πŸ˜‰

Adding such metrics would also be relatively easy using: https://github.com/siimon/prom-client

Underlying vulnerability/ies

I don’t think there is a CVE or anything open for it.

In OWASP Top 10 terms would probably be a β€œSecurity Misconfiguration” or β€œSensitive Data Exposure” Challenge.

Expected difficulty

βœ”οΈ / ❌ Difficulty
βœ”οΈ ⭐
βœ”οΈ ⭐⭐
❌ ⭐⭐⭐
❌ ⭐⭐⭐⭐
❌ ⭐⭐⭐⭐⭐
❌ ⭐⭐⭐⭐⭐⭐

Possible attack flow

  1. Open Browser.
  2. Open /metrics endpoint.
  3. Profit of all the juicy information πŸ˜‰

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bkimminichcommented, Feb 12, 2020

Great job, @Scar26! Thank you! Please send me an email with your address so I can send you a couple of stickers!

0reactions
github-actions[bot]commented, Feb 27, 2022

This thread has been automatically locked because it has not had recent activity after it was closed. πŸ”’ Please open a new issue for regressions or related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ ⭐ ] Exposed Prometheus Metrics Endpoint #1275 - GitHub
Challenge idea Description Modern services often expose metrics about the current state of the service / server on a /metrics endpoint.
Read more >
How attackers use exposed Prometheus server to exploit ...
Here are three good examples: Exposed Prometheus metrics Endpoint Β· Don't let Prometheus Steal your Fire Β· Hacking Monitoring for Fun and Profit....
Read more >
Don't let Prometheus Steal your Fire - JFrog
By scraping real-time metrics from various endpoints, Prometheus allows easy observation of a system's state in addition to observation ofΒ ...
Read more >
Sending the generated metrics to Prometheus and Grafana
This video shows how to configure the OpenTelemetry collector to send generated metrics to Prometheus. It also shows how to use Grafana toΒ ......
Read more >
Metrics - Benthos
The default metrics configuration is to expose Prometheus metrics on the service-wide HTTP endpoint at the endpoints /metrics and /stats .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found