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.

[False Positive] HTTP request to localhost

See original GitHub issue

Rule ID

DS137138

What the rule matched

        let resp = client
            .get("http://127.0.0.1:8080/infra/ready")

Why should this not be matched?

I believe the guidance in DS137138 is overly prescriptive. DS440000 is a bit more nuanced:

TLS Everywhere is a monicker the really means “encrypt all network traffic whenever it crosses a trust boundary”. A trust boundary is just a fancy phrase meaning, “where you trust one side differently than the other”. However, like all things, there’s some grey-area in here. … Scenarios where you almost certainly don’t cross a trust bounary include:

  • Connecting to a service running on the same operating system.

I think this rule shouldn’t match if the request is to localhost or 127.0.0.1.

In terms of motivation for why we’re doing non-TLS requests to localhost: this endpoint is exposed to be used for Kubernetes health probes, described at Configure Liveness, Readiness and Startup Probes#HTTP Probes. These are expected to be HTTP, and even with TLS it skips certificate verification so adding TLS doesn’t add any value:

For an HTTP probe, the kubelet sends an HTTP request to the specified path and port to perform the check. The kubelet sends the probe to the pod’s IP address, unless the address is overridden by the optional host field in httpGet. If scheme field is set to HTTPS, the kubelet sends an HTTPS request skipping the certificate verification.

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gfscommented, Mar 27, 2023

Fix is developed in #470, to be merged pending pipeline issues being resolved.

1reaction
gfscommented, Mar 22, 2023

@caendesilva Apologies. It looks like the earlier fix depended on a code fix that had not been backported to 0.7. I’m working on porting that change now and hopefully will have an update soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

People say "false positives" in request smuggling. What ...
False negative : When HTTP request smuggling exists, but a web application firewall (WAF) or anything else blocks it.
Read more >
The Danger of Exposing Localhost to Internet
In this case, it could be a false alarm (hopefully). Are these legit reasons to block ngrok and friends? Probably yes. But, it...
Read more >
How to tune your WAF installation to reduce false positives
Tuning your WAF installation to reduce false positives is a tedious process. This article will help you reduce false positives on NGINX, ...
Read more >
Issues with modsecurity OWASP and false positives.
I believe the ones from 127.0.0.1 are false positive. I believe a cPanel script is checking /whm-server-status to make sure the server is...
Read more >
Server Side Request Forgery (SSRF) Attacks & How to ...
Server-Side Request Forgery (SSRF) attacks allow an attacker to make requests to any domains through a vulnerable server.
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