Government Rails Site Hit Hours After CVE Patch

(rietta.com)

74 points | by rietta 6 hours ago

9 comments

  • throwatdem12311 36 minutes ago
    Just sent this to my boss. Felt like tossing a grenade over a fence into a party of unsuspecting people.

    We don’t use ActiveStorage but Claude was able create a similar exploit in own our app in the exact same way via our own file upload library in 3 minutes simply by point Opus 5 at our site and asking it if we were vulnerable to an attack similar to KindaRails2Shell.

    What a time to be alive.

  • kazinator 24 minutes ago
    > That is about as bad as it gets and meant that any delay in patching was an existential risk of imminent compromise.

    Overdramatized.

    It means compromise if you delay patching and don't take the unpatched deployment offline.

    Oh right, this is government sites; every second of down time is lost revenue.

  • jeremyjh 1 hour ago
    Nice write up, Claude.
  • comrade1234 5 hours ago
    Do you have to have matlab running on your rails server for this to happen?
    • bradly 5 hours ago
      Not running, but supported. You can check your app with:

          bin/rails runner '
            require "vips"
            puts "ruby-vips #{Vips::VERSION}  libvips #{Vips.version(0)}.#{Vips.version(1)}.#{Vips.version(2)}"
            begin
              Vips::Operation.new("matload")
              puts "matload PRESENT - this build can reach libmatio"
            rescue Vips::Error
              puts "matload ABSENT - this build cannot reach libmatio"
            end
          '
      
      This is from the Rails official docs for the CVE which, interestingly, they only released as an agent skill. https://github.com/rails/rails-forensics-CVE-2026-66066/blob...
      • XenoCyber0 8 minutes ago
        An agent skill is the official distribution format for the forensics on a 9.5. I mean, I get it, anyone running a Rails app right now is pasting "am I affected" into an agent anyway, but it's the kind of thing that would've sounded like a joke a couple years ago.
      • comrade1234 1 hour ago
        Why would you have matlab on an external server? People don't even have a compiler on the server in this situation. Crazy.
    • fishtoaster 5 hours ago
      I think the answer is no - this would affect any Rails app with default settings that uses ActiveStorage. The "Preconditions" recap at the bottom here has all the appropriate caveats: https://ethiack.com/info-hub/research/kindarails2shell-how-a...
    • rietta 5 hours ago
      I am not sure, but my read on the original disclosure is no. libvips itself has a variant processor for matlab v5 files, which the exploit took advantage of.
      • kawsper 5 hours ago
        libvips also have a block_untrusted mode where it will block unsafe loaders, .mat seems to be marked as untrusted:

            vips -l
            VipsForeignLoadMat (matload), load mat from file (.mat), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
        • rietta 5 hours ago
          Correct, which is how the ActiveStorage gem was patched. After this, Rails raises a Vips::Error: VipsForeignLoad exception on an attempted variant render of a malicious file. I plan on writing a technical detail post soon with some more code level details and "indicators of compromise" but this one was getting long. This is more for management to understand why wait to patch is a major issue. The discovery to active exploit attempt timeline is the story here.
  • dorianmariecom 5 hours ago
    i thought cloudflare would protect against those no?
    • bastawhiz 12 minutes ago
      Since the vulnerability is exploited by a crafted binary file, I think that isn't something that CF's managed ruleset is able to protect against. They have the ability to scan incoming files with antivirus, but if the exploit is small and simple and can be mutated per request, I think it's unlikely any AV would pick it up.
    • rietta 5 hours ago
      Cloudflare or a WAF may or may not help. These can often catch and block specific bot traffic, but not every attack payload is delivered naively. It would be part of a defense in depth. Having the underlying vulnerability fixed is critically important. For those on AWS, WAF & Shield is also very useful but at the end of the day these let legitimate traffic through, such as legitimately uploading a file that only in its contents is malformed.
    • ceejayoz 5 hours ago
      Where does it say the site used Cloudflare?
  • hobonation 4 hours ago
    [dead]
  • shevy-java 4 hours ago
    DHH needs to focus on Rails again rather than Omarchy.
    • stephenhuey 2 hours ago
      He’s still very supportive of Rails. Come join us at RailsWorld in Austin later this month and see for yourself!
    • tyre 4 hours ago
      What does DHH have to do with this? Omarchy itself isn’t known for being secure; here is a root escalation from five days ago https://news.ycombinator.com/item?id=49499854

      The rails developers are incredibly smart and capable. They patched the exploit. The problem is that it’s too easy to reverse engineer based on the patch. They can’t do anything about that.

      • dangond 2 hours ago
        > What does DHH have to do with this?

        DHH created Rails.

  • tyre 3 hours ago
    This post could be 10% as long:

    - There was a bug with a patch

    - We applied it to our clients

    - There were live exploits within eight hours of the patch being released

    - The Rails team had to expedite release of the technical details because POCs obviated the need to embargo