Live data from Hacker News

BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

badhost.org

31–40 of 65 posts

Re: BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

#31

This is a bad one. Rating it a medium understates how hard it hits thousands of downstream projects and billions of installs. People need to patch asap. I'm normally against the "giving a bug a name, logo, and website" trope, but this one is getting poor patch rates because of it being rated a medium and landing right before a big American holiday weekend.

I don't know if many people run FastAPI directly without any reverse proxy, load balancer etc. in front of their services.

Probably this is why it is marked as medium.

Re: BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

#32
post #26

Never, ever, ever transform URIs and paths by string manipulation. If you think pulling in a library for this is overkill, it is not. (Lesson learned from trying to quickly write my own function to make ".." to go back one URL segment that took 3 hours and discovering the URI spec contradicts my intuition depending on whether the URI is a URL or filesystem path.)

I don't believe Python's urllib has a function that takes what HTTP terms an "origin-form" (an absolute path with possibly a query attached to it with "?") and parses it apart.

Still, the RFC 9112 that defines HTTP/1.1 basics requires that, for the purposes of URI reconstruction, "if there is no Host header field or if its field value is empty or invalid, the target URI's authority component is empty."

Re: BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

#33
post #29

Earlier quoted context omitted.

You're relying on everyone in the world to set things up in a way that provides defense in depth. Not everyone is going to do that. Which means there's going to be a lot of cases where people don't do the safe thing. Especially, as other's have said, in the case of MCP servers, where the spec mandates exposed oauth.

The saving grace here is that people are most commonly doing this for reasons other than as a defense - serving static files efficiently, combining multiple services, caching, DDoS protection, etc. There are certainly some directly exposed FastAPI instances but it’s been against the grain for decades.

Or probably the most straightforward one, which is SSL termination. Most backend software usually has very bad support for HTTPS communication, while it's typically extensively documented for something like nginx. It also catches some other strangeness like making it easier to update the certificate.

The biggest risk is incorrect usage of the default_server directive, the proper way in which to handle it isn't usually taught in most "here's how you use nginx" tutorials. Most usually just have you edit the default server blocks.

Tldr that covers 99% of all cases: you want 2 default server blocks, one on port 80 and one on port 443. The one on port 80 should only return 444 (an internal nginx status code that stops the connection immediately with no response), while the one on port 443 should use ssl_reject_handshake to terminate the SSL connection as quickly as possible without causing strange errors (you also need a self-signed certificate because otherwise openssl refuses to do protocol negotiation correctly, but the cert doesn't actually do anything). After that, specify your actual domains as separate server blocks using server_name (including a separate one for each to do the port 80->443 redirect).

Arguably this should be the default configuration shipped by distros, but it isn't for some reason, which doesn't help matters.

Re: BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

#36
post #20

Earlier quoted context omitted.

fastAPI will give you `/openapi.json`, `/docs` with no extra effort function name becomes a human readable summary, string docs the description edit: bottle.py and fastapi are the most significant contributions to web frameworks in python — decorators for path handlers, typed input/output, automatic docs

Is it like flask, but even flaskier?

the lore: https://en.wikipedia.org/wiki/Flask_(web_framework)#History

Re: BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

#37

Earlier quoted context omitted.

Ironically typing ‘make sure my server is secure’ into an LLM either wasn’t done, or missed it until now.

The posted page has an entire section titled "Why didn't Mythos find this?" tl;dr: the bug spans three components in different code bases that when looked at in isolation each do reasonable things. The bug is in the interaction, in the assumed properties of the value that eventually gets exposed as request.url.path. That was apparently too subtle for current Anthropic models to spot

So an LLM was unable to reason about a codebase to find cross-library vulnerabilities.

Your response was a weak excuse, it’s a clear demonstration of the shortcomings of LLMs which will inevitably cause headlines in the future.

Re: BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

#38

This is a bad one. Rating it a medium understates how hard it hits thousands of downstream projects and billions of installs. People need to patch asap. I'm normally against the "giving a bug a name, logo, and website" trope, but this one is getting poor patch rates because of it being rated a medium and landing right before a big American holiday weekend.

Also requires that you build specific kind of logic in your access control. So it really depends on implementation. Some codebases are vulnerable where as others are not.

Re: BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

#39
post #7

If you read the advisory and are wondering what starlette is, from it's web page: starlette is a lightweight ASGI framework/toolkit, which is ideal for building async web services in Python. It's used a lot in the data heavy AI world for it's efficiency shipping large files. This includes lots and lots of production servers. From the advisory: this includes LLM inference servers like vLLM, LLM proxy servers like Lite…

Notably, Starlette powers FastAPI, an extremely popular Python framework for building HTTP services.

Is this still true?

Re: BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

#40

Earlier quoted context omitted.

Notably, Starlette powers FastAPI, an extremely popular Python framework for building HTTP services.

Is this still true?

Yes, it's literally the first bullet point on the project's website.
Post reply on HN