Taking over US Treasury subdomains for $3 each

(intruder.io)

204 points | by negura 14 hours ago ago

43 comments

  • chinathrow 10 hours ago

    > AWS confirmed with us that they don’t plan to make changes, as they see the takeover as depending on customer-side DNS records rather than an issue in their services. They also told us they treat rapid allocation and release as a policy violation and have controls against it. Whilst this is true, they could do more to prevent the issue in our opinion, and the vulnerability class remains open due to their position.

    • bell-cot 7 hours ago

      To be fair, AWS is downstream of the real problem here. And contacting the US Treasury and insisting that they fix their DNS could go badly wrong for AWS - so leaving that to outside security researchers and hard-core masochists looks like the right business decision.

      • fn-mote 5 hours ago

        The suggestion to Amazon was to apply more effective rate limiting, not contact the treasury department.

        Amazon already says the behavior is against their terms of service, but their penalty isn’t effective enough.

        • bell-cot 5 hours ago

          True. OTOH, industry standard for "harmless" (to the immediate provider) ToS violations is feeble-at-best enforcement.

          I'm not calling that good - but there are real business reasons for it. If nothing else, at AWS's scale, better enforcement could cost >$10k/day. And how long would it take for social (and maybe legal expectations) to shift, toward "If AWS is somehow involved, then it's their responsibility to mitigate or repair the problem"?

  • RandomBK 9 hours ago

    I want to zoom in on the HTTPS angle of this.

    The ability to provision a valid cert for any domain so long as you could host a file on that domain has undoubtedly eased the rapid adoption of SSL, but makes attacks like this extra devastating. Are EV certs still a thing these days? Perhaps certain domains should be given extended validation requirements? I'm shocked that a .gov could fall prey to something like this

    • judge2020 4 hours ago

      EV Certs only work if there is some extra UI signal to the user so that they can tell a "real" certificate for a website from a fake one that was improperly issued. But they mostly lead to classism or companies using EV certs to make their website stand out by having their company name in the URL bar (see https://www.troyhunt.com/extended-validation-certificates-ar... / discussion of https://news.ycombinator.com/item?id=15904513).

      This attack mentioned is now somewhat fixable with new CAA extensions that enable method binding and/or CA provider account restrictions, with CA/B mandating all CAs support these starting in March of this year. Example record:

          ycombinator.com.  300  IN  CAA  0 issue "pki.goog; accounturi=<GTS-ACCOUNT-URI>; validationmethods=dns-01"
      
      See https://letsencrypt.org/docs/caa/#the-validationmethods-para...
      • g-b-r 3 hours ago

        That CAA validationmethod is very interesting, I wasn't aware of it.

        It could indeed provide a pretty strong binding between DNS domains and servers, and largely prevent these attacks.

        If you're able to use it securely (see e.g. https://www.eff.org/deeplinks/2018/02/technical-deep-dive-se...), for Let's Encrypt I'd definetely use DNS-01 going forward.

        Or just accounturi, actually.

      • kbolino 4 hours ago

        EV certs could be used without a UI signal, if there was a non-deniable mechanism for a domain owner to require them. There is no such mechanism because an attacker can easily suppress a DNS record.

        It's just another case of "we could have nice things if we had DNSSEC, but DNSSEC is still not viable, so we can't have nice things".

        • judge2020 4 hours ago

          > There is no such mechanism because an attacker can easily suppress a DNS record.

          I think what I presented mostly fits for this, just not "EV only". A CAA with `issuewild` and an `accounturi` extension would ensure only your account under a specific CA can issue for your domain (assuming said CA supports it). EV certificates meld legal concerns into an area where you really just care about domain control.

          • kbolino 3 hours ago

            Yes, and CAA records work around the DNS-deniability issue because they are only checked by CAs and those CAs are required to use "multiple perspectives" when checking for them.

    • ThunderSizzle 7 hours ago

      The problem is that HTTPS was used to try to convey 1. That your communication to the server is secure from a third party (in the middle), and 2. That server is owned by the second party entity itself (that is what extended EV basically is)

      #2 should've always been entirely split from #1, and browsers conflating them has probably caused much grief. Beyond that, #2 doesn't prevent phishing through similarly named extended EVs - each Googgle vs Google.

      If browsers only used to communicate #1, and we found an alternative mechanism for "the other side is who they claim to be", it'd probably be a better result .

      • JambalayaJimbo 5 hours ago

        I don’t understand how you could have #1 without #2. Or, confidentiality is inherently linked to authentication. How can you be sure your communication is kept secret from all third parties if you do not know you’re speaking with the second party?

    • kbolino 4 hours ago

      > makes attacks like this extra devastating

      No, it doesn't. If you could steal an IP with plain HTTP, you would get the same result.

    • kmoser 30 minutes ago

      > I'm shocked that a .gov could fall prey to something like this

      The weak link here is that the government is relying on a private entity (Amazon/AWS) to manage critical settings that the government has no control over. They've outsourced security in the name of convenience.

  • xhrpost an hour ago

    I'm struggling to understand how HTTPS/TLS takeover works here. Isn't an initial handshake required where the server must use its private key? You could push your own cert but wouldn't the CA verification fail since your announced public key doesn't match what is valid for the domain?

    • lmz 35 minutes ago

      ACME http-01 challenge.

  • lmz 11 hours ago

    AWS could offer an Elastic IP record type for Route53 that is deleted automatically.

    • w3ll_w3ll_w3ll 10 hours ago

      Already exists, they are called Alias record.

      https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/re...

      "An Amazon VPC interface endpoint – Route 53 responds with one or more IP addresses for your interface endpoint."

      "When you use an alias record to route traffic to an AWS resource, Route 53 detects changes in the resource on its own. For example, suppose an alias record for example.com points to an Elastic Load Balancing load balancer at lb1-1234.us-east-2.elb.amazonaws.com. If the IP address of the load balancer changes, Route 53 starts responding to DNS queries with the new IP address."

      • lmz 10 hours ago

        It's been a while since I did this, but the page doesn't mention Elastic IPs as eligible Alias targets.

        • w3ll_w3ll_w3ll 9 hours ago

          I think you can point to any network interface on a VPC, but I never did it myself.

          • lmz 8 hours ago

            I guess that would work too, for cases where the thing you move across is the ENI.

    • relistan 11 hours ago

      +1 Seems like an obvious and good solution.

  • bilekas 11 hours ago

    > moved the matching IPs across. It worked without any issues, despite sitting in the same organization as the banned account

    That really feels like an oversight on AWS part no ?

    • iLoveOncall 9 hours ago

      It really depends on the goal of the suspension. I highly doubt it's actually to prevent actual malicious abuse, and more to force a customer with a broken script or pipeline to fix it.

  • scalableUnicon 6 hours ago

    I remember reading something like this long back, and dug this out after a bit of searching: A Recycled IP Address Caused Me to Pirate Books by Accident(https://news.ycombinator.com/item?id=17020944)

    Should definitely clean up DNS records after server/IP removals, seems to be actively exploited even long before.

  • Jmstdy95 6 hours ago

    while I think AWS could helps with that, but the problem would still be about the negligence of the one handling the DNS.

  • pwmglenn 6 hours ago

    Couldn't you check this much faster? isnt this an embarrassingly parallel problem? or im i missing something?

    • fn-mote 5 hours ago

      You’re missing the friction of requesting an increased quota. The article mentions the 10x speed up is the most you can get without including an explanation with your request for 25x (or more?).

  • edoceo 12 hours ago

    Gotta have a host-removal-checklist. Remove these IPs from FW, WAF, DNS and other records on teardown. One place I worked would hold the IPs unused for 60 days. And review DNS quarterly (why not automate?)

    • stackskipton 3 hours ago

      Sure, and an argument for IaC. When setting up DNS in Azure, I always put DNS records in same terraform for resource. So during typical teardown where it's terraform destroy, it should get destroyed as well.

    • dotancohen 10 hours ago

      The typical answer to that is that IPv4 addresses are scarce, thus valuable, thus to be reallocated as soon as possible. My opinion on the topic has gone back and forth over the years.

    • syshyk 11 hours ago

      In my experience, no one wants to take responsibility for the process, and higher ups don't want to make the decision on who should.

  • g-b-r 4 hours ago

    The detachment between DNS and the IPs and machines they point to is really risky

    People often forget to tell their DNS administrator that they stopped using what they point to; or aren't even aware that they're supposed to do it in the first place.

    And even when you manage the DNS records yourself, it's not that hard to forget to maintain them.

    I think there should just be a cryptographic link between a DNS record and the machine pointed to.

    Which would mean that you'd break everything if you forgot to keep the DNS records updated, but that seems better than risking something like what's reported in the article.

    Very unfortunate that past efforts towards that were dropped, even the original DNSSEC KEY record supported it, apparently.

    I guess that nowadays it would be possible with ECH, but only in the rare case that you're not using a CDN or shared host.

  • davedx 10 hours ago

    This is awful negligence on both sides IMO - the orgs who don't bother to maintain DNS hygiene, and AWS for allowing an account explicitly banned for EIP abuse to then transfer its EIPs to a different account without any safeguards.

    This kind of attack is also so simple that anyone can trivially reproduce it.

    Just yesterday I had a meeting with a coworker concerning a US .gov domain and we both agreed how necessary it was for this to be carefully managed with principle of least privelege and MFA and good security policies. Then I read articles like this, and that X post showing how the US Treasury CIO can't be bothered working because he's busy vibe coding a game, and just wonder why the hell I bother?

  • mschuster91 10 hours ago

    Cool, a vulnerability report that does not immediately reek of AI in both copytext and visuals.

    Very nice, much appreciated.

  • g-b-r 3 hours ago

    Keep in mind that CNAME records can be forgotten behind too, and are possibly even easier to be taken over by attackers (I had talked about it a bit at https://news.ycombinator.com/item?id=50511688).

    • icedchai 3 hours ago

      Entire domains can also be forgotten and re-registered. This may allow you to gain control of related resources if you have the appropriate email accounts in place.

      • g-b-r an hour ago

        True, the CNAME issue relies on forgetting entire domains, anyhow (just less visible ones, if no link points to them directly)

        • icedchai 24 minutes ago

          It's also possible there was a delegated subdomain, and one could take it over based on name server IP. This is probably pretty rare.

  • yellow_lead 11 hours ago

    That cio of the Treasury has something new to look at

    • dotancohen 10 hours ago

      The issue is not treasury specific.

  • jasonkhanlar 10 hours ago

    "the vulnerability class remains open due to Amazon Web Services position."

  • natas 12 hours ago

    pretty neat!