18 comments

  • magnio4 hours ago
    Never, ever, ever transform URIs and paths by string manipulation. If you think pulling in a library for this is overkill, it is not.<p>(Lesson learned from trying to quickly write my own function to make &quot;..&quot; 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.)
    • unbelievr56 minutes ago
      Differentials between different URI parsers are a huge source of bugs. The amount of shenanigans you can do inside URIs is bonkers, and trying to handle this by yourself with some regex and string splitting is absolutely insane.<p>Like <a href="https:&#x2F;&#x2F;www.example.com:443@203569230:8080&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.example.com:443@203569230:8080&#x2F;</a> will send you to the IP address &quot;12.34.56.78&quot; on port 8080 using basic authentication with the domain and port as username and password. If your code tries to split by `:` or check that the URI starts with some specific string, then it won&#x27;t be good enough. Indeed, use a library that you trust.
    • Joker_vD3 hours ago
      I don&#x27;t believe Python&#x27;s urllib has a function that takes what HTTP terms an &quot;origin-form&quot; (an absolute path with possibly a query attached to it with &quot;?&quot;) and parses it apart.<p>Still, the RFC 9112 that defines HTTP&#x2F;1.1 basics requires that, for the purposes of URI reconstruction, &quot;if there is no Host header field or if its field value is empty or invalid, the target URI&#x27;s authority component is empty.&quot;
      • hft1 hour ago
        <a href="https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;urllib.parse.html" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;urllib.parse.html</a>
        • Joker_vD46 minutes ago
          Yep, none of them are suitable for this use case; you need to validate the Host header first and reconstruct the URI first before parsing it.
      • teh641 hour ago
        [dead]
  • nickcw6 hours ago
    If you read the advisory and are wondering what starlette is, from it&#x27;s web page: starlette is a lightweight ASGI framework&#x2F;toolkit, which is ideal for building async web services in Python.<p>It&#x27;s used a lot in the data heavy AI world for it&#x27;s efficiency shipping large files. This includes lots and lots of production servers.<p>From the advisory: this includes LLM inference servers like vLLM, LLM proxy servers like LiteLLM, AI agent frameworks, MCP gateways, and custom APIs. MCP servers are especially at risk because the MCP spec mandates unauthenticated OAuth discovery endpoints, providing a reliable path for exploitation.
    • alex_suzuki6 hours ago
      Notably, Starlette powers FastAPI, an extremely popular Python framework for building HTTP services.
      • spennant2 hours ago
        Is this still true?
        • b40d-48b2-979e1 hour ago
          You may be thinking of Litestar (previously named Starlite) that was based on Starlette akin to FastAPI but then went their own direction implementing a framework rather than relying on an upstream for their core product.
        • discord232 hours ago
          Yes, it&#x27;s literally the first bullet point on the project&#x27;s website.
        • sedimannapoleon1 hour ago
          [dead]
    • hsbauauvhabzb5 hours ago
      Ironically typing ‘make sure my server is secure’ into an LLM either wasn’t done, or missed it until now.
      • wongarsu3 hours ago
        The posted page has an entire section titled &quot;Why didn&#x27;t Mythos find this?&quot;<p>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
        • hsbauauvhabzb2 hours ago
          So an LLM was unable to reason about a codebase to find cross-library vulnerabilities.<p>Your response was a weak excuse, it’s a clear demonstration of the shortcomings of LLMs which will inevitably cause headlines in the future.
          • wongarsu1 hour ago
            If you point an LLM at a middleware and ask it to find vulnerabilities, then not finding this is a shortcoming.<p>Whether &quot;LLM failed to spot vulnerability that took humans 8 years to find&quot; is a great headline about shortcomings of LLMs is questionable, but it is a good example of a category of bug that is particularly hard to spot for humans and LLMs alike
  • s2l6 hours ago
    From the link, on how the attack works:<p>An attacker can send a crafted request like GET &#x2F;protected with a Host: example.com&#x2F;health?x= header. The request will reach the &#x2F;proteced path, but request.url would be <a href="https:&#x2F;&#x2F;example.com&#x2F;health?x=&#x2F;protected" rel="nofollow">https:&#x2F;&#x2F;example.com&#x2F;health?x=&#x2F;protected</a>, and request.url.path would return &#x2F;health instead of the real request path.
    • nickcw4 hours ago
      I found a similar vulnerability in the Zeus Web Server ( <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Zeus_Web_Server" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Zeus_Web_Server</a> ) in January 2000.<p>Zeus had a great feature where you could set up virtual servers just by creating directories. So if you wanted to host www.example.com and www.anotherexample.com you just created two directories of those names like that and away you went.<p>I discovered that the if you sent `Host:` headers which started with `&#x2F;` then you could use it to traverse the file system and read any file you wanted.<p>Plus ça change, plus c&#x27;est la même chose!
    • Muromec5 hours ago
      So the classic case of two parsers disagreing and being too permissive in accepting input
    • huflungdung4 hours ago
      [dead]
  • noirscape6 hours ago
    If you&#x27;re using nginx&#x2F;apache&#x2F;literally anything that does reverse proxying correctly, this shouldn&#x27;t be a problem unless you&#x27;re routing all traffic over default_server rules unstead of server_name (or the equivalent).<p>They should be stopping this attack at the door (even if only to clean out your logs from scraper door knocks), which is probably why it went unnoticed for years. I don&#x27;t think anyone would be deploying {A,W}SGI servers on public facing ports these days. Even if only because SSL termination is much easier in the proxy layer.<p>Also good lord that ARS article is a mess. What the hell happened there? An ASGI server isn&#x27;t unique to AI or anything, it&#x27;s just a regular supply chain dependency. I kinda expect better from ARS on stuff like this.
    • ostif-derek4 hours ago
      You&#x27;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.<p>Which means there&#x27;s going to be a lot of cases where people don&#x27;t do the safe thing.<p>Especially, as other&#x27;s have said, in the case of MCP servers, where the spec mandates exposed oauth.
      • acdha3 hours ago
        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.
        • noirscape3 hours ago
          Or probably the most straightforward one, which is SSL termination. Most backend software usually has very bad support for HTTPS communication, while it&#x27;s typically extensively documented for something like nginx. It also catches some other strangeness like making it easier to update the certificate.<p>The biggest risk is incorrect usage of the default_server directive, the proper way in which to handle it isn&#x27;t usually taught in most &quot;here&#x27;s how you use nginx&quot; tutorials. Most usually just have you edit the default server blocks.<p>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&#x27;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-&gt;443 redirect).<p>Arguably this should be the default configuration shipped by distros, but it isn&#x27;t for some reason, which doesn&#x27;t help matters.
    • anakaine5 hours ago
      Ars has had a depreciating quality the past few years by most accounts. They&#x27;ve been trying a bit harder recently it seems, but shaking off the allure of half baked short form journalism is hard, I guess.
  • ostif-derek1 day ago
    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&#x27;m normally against the &quot;giving a bug a name, logo, and website&quot; 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.
    • acdha12 hours ago
      I agree it’s fairly bad on its own but it’s substantially mitigated if you aren’t exposing Starlette&#x2F;FastAPI directly to the internet – if you use a CDN, load-balancer &#x2F; API Gateway, or a fronting web server it’s likely that your service is protected since the attacks depend on characters which are not valid in DNS (and in the first couple of cases, likely need to match to route traffic to the right customer).<p>As an example, I just confirmed that both Cloudflare and AWS ALBs reject all of the attack patterns. Still not good, lateral movement is a time-honored tactic, etc. but it buys time to patch.
    • Ekaros2 hours ago
      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.
    • ExoticPearTree3 hours ago
      I don&#x27;t know if many people run FastAPI directly without any reverse proxy, load balancer etc. in front of their services.<p>Probably this is why it is marked as medium.
  • 0xbadcafebee2 hours ago
    I need to start some kind of public counter for major vulnerabilities that could have been prevented with a software building code. It&#x27;s been ticking up a lot latey
  • burner4200425 hours ago
    Notably CVE-2026-48710 hasn&#x27;t been added into cloud sec vuln catalogs quite yet. Since fastapi ~is starlette, expect the later half of this week &#x2F; early next to be busy.
  • janci4 hours ago
    path-based auth middleware is a bad practice IMHO
    • acdha3 hours ago
      I think there’s a solid argument for global auth middleware, where this is a problem if you use the path for exceptions like health-checks or a login endpoint.
  • andrewstuart6 hours ago
    Setting aside this issue, Starlette is a really great web server.<p>If you do async python I strongly recommend it.<p>FastAPI is built on Starlette - to be honest I don’t see the point of the extra baggage - just use Starlette.
    • 0123456789ABCDE5 hours ago
      fastAPI will give you `&#x2F;openapi.json`, `&#x2F;docs` with no extra effort<p>function name becomes a human readable summary, string docs the description<p>edit: bottle.py and fastapi are the most significant contributions to web frameworks in python — decorators for path handlers, typed input&#x2F;output, automatic docs
      • Muromec5 hours ago
        Is it like flask, but even flaskier?
        • 0123456789ABCDE2 hours ago
          the lore: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Flask_(web_framework)#History" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Flask_(web_framework)#History</a>
        • andrewstuart4 hours ago
          Yes sir, more flaskatronic.
  • jofzar4 hours ago
    [flagged]
  • onebluecloud1 hour ago
    [flagged]
  • reconapp2 hours ago
    [flagged]
  • ylk1 day ago
    The URL was meant to be <a href="https:&#x2F;&#x2F;badhost.org" rel="nofollow">https:&#x2F;&#x2F;badhost.org</a>, the site accidentally still has the old canonical meta tag.
  • zuogl5 hours ago
    [flagged]
  • Ozzie-D5 hours ago
    [flagged]
  • nine_ch6 hours ago
    [flagged]
  • dividendflow5 hours ago
    [dead]
  • phoronixrly7 hours ago
    [flagged]