Five Security Bugs in Three Days

This is a real-world rehashing of the theoretical blog post https://schneide.blog/2024/12/30/surviving-the-big-one-in-it-part-i/ about surviving a critical security flaw.

Last week was filled with several critical security vulnerabilities that affected both us and our IT infrastructure and the project deployments of our customers. What made it tricky was that we had to analyze, decide and act fast for each vulnerability while triaging the different vulnerabilities against each other the moment a new flaw was published. So it was a multi-dimensional task: Find the highest-risk vulnerability, mitigate the highest-risk projects and products and continue with the second-highest risk vulnerability, its highest-risk projects and so forth.

Let’s have a look at the vulnerabilities that kept us busy:

  • java4shell (CVE-2026-114938): Remote Code Execution flaw in Java. Affects recent versions running on recent CPUs only.
  • ruby2shell (CVE-2026-132825): Remote Code Execution flaw in Ruby. Affects virtually every Ruby version on any hardware.
  • nginx2root (CVE-2026-123007): Remote Code Execution flaw in nginx. Affects every nginx installation except with specific configuration settings.
  • php (CVE-2026-129289 and others): Remote Code Execution flaws in PHP. Affects installations with different configuration settings.
  • wordpress (CVE-2026-119977): Remote Code Execution flaw in wordpress core. Affects all wordpress installations.

The last two vulnerabilities only affected our infrastructure, because we don’t develop in PHP or deploy wordpress instances, but the first three were relevant for services we use ourself (like ruby2shell and gitlab) and our customers.

Own oxygen mask first

One core principle of disaster mitigation is to prioritize self-preservation over assistance to others. By securing your own life support first, you ensure that you can stabilize yourself enough to be a reliable source of help.

Applied to our situation, we would be of no long-term use if we patched our customer’s deployments but got compromised on our own servers. The dreaded malware would just make one more stop on our infrastructure before spilling over to our customers. So we assessed our risk and our affected infrastructure at the beginning of each triage run.

Once again, the PHP and wordpress vulnerabilities had a different flavor than the rest. Our homepage ran on a self-hosted wordpress instance and used PHP underneath, but other than that, we don’t employ the technology. And the homepage server is isolated from the rest of our servers. So both flaws meant work, but without the risk of overwhelming scaling factors.

In fact, we already had prepared a static site generator version of the homepage that was free from PHP and wordpress. Our plan was to switch at the end of the year, but we accelerated the process and put it live last week. We didn’t patch wordpress, we removed it from the equation.

Triage in an active situation

Bringing the relevant information for the other three vulnerabilities together in one place, deciding the risk for each affected instance and planning remedies was a crucial task in the beginning of each situation. Our “mission whiteboard” was a wiki page with a large table that listed all potentially affected projects and documented our current discovery progress and state of knowledge.

This table is both the central place to reflect our mission state and to journal our decisions, actions and inactions. We explicitely documented if we found a project to be unaffected and that we cease mitigation work on it. The goal is to be able to give account of all mitigations we made or didn’t make. It is always easy to remember the actions you took, but a lot harder to explain why you didn’t take certain actions. We documented it the moment we made the decision against the action.

If we decided to take action, we put it on the todo list of our operators and began working on this list as soon as the high risk targets were examined. The actions ranged from contacting the customer to inform them and discuss sensible measures over creating and deploying patches to shutting down systems in order to patch them in a controlled setting later. At this point, the mission ran smooth and coordinated.

Software guys forget about hardware

One point that stood out in our post-mortem was that the java4shell vulnerability relied on certain CPU types (or hardware instruction sets) to be relevant. We hadn’t current information about our customers’ hardware, so we treated all instances as affected. In retrospect, we could have saved half of our effort because we would have ruled out an instance as “not vulnerable” due to the hardware aspect. In our experience, it’s unusual that a software vulnerability is so dependent on hardware, so our process didn’t prepare for that aspect, but we think about improvements to be more informed next time.

Closing thoughts

As busy as those days were, they didn’t lean into chaotic. Our incident management process guided us through the crisis, even as the crisis became a multi-event thing. But three things stand out:

  • The amount of concurrent incidents we as humans can handle is clearly limited. Double the amount of vulnerabilities that happen at virtually the same time again and we can’t keep up with it anymore. And that might happen, as this curve suggests:

These numbers are frightening enough, but you can see from the “year-to-date (YTD)” marking that the last bar is actually still rising.

  • The timing of such incident is crucial. If this situation had unfolded over a weekend instead of the middle of the week, we wouldn’t have had the manpower and seamless customer communications that were essential in dealing with it. I sincerely hope that we put a moratorium on the weekends in regard of IT security problems. Let’s not have that stress 24/7 for the next years, please.
  • This is probably the result of current AI finding low-hanging fruits on the IT security vulnerability tree during peacetime. I can’t fathom the situation if an opposing force uses tomorrow’s AI in a coordinated attack to exploit the higher regions of that metaphorical tree.

Integrating API Key Authorization in Micronaut’s OpenAPI Documentation

In a Java Micronaut application, endpoints are often secured using @Secured(SecurityRule.IS_AUTHENTICATED), along with an authentication provider. In this case, authentication takes place using API keys, and the authentication provider validates them. If you also provide Swagger documentation for users to test API functionalities quickly, you need a way for users to specify an API key in Swagger that is automatically included in the request headers.

For a general guide on setting up a Micronaut application with OpenAPI Swagger and Swagger UI, refer to this article.

The following article focuses on how to integrate API key authentication into Swagger so that users can authenticate and test secured endpoints directly within the Swagger UI.

Accessing Swagger Without Authentication

To ensure that Swagger is always accessible without authentication, update the application.yml file with the following settings:

micronaut:  
  security:
    intercept-url-map:
      - pattern: /swagger/**
        access:
          - isAnonymous()
      - pattern: /swagger-ui/**
        access:
          - isAnonymous()
    enabled: true

These settings ensure that Swagger remains accessible without requiring authentication while keeping API security enabled.

Defining the Security Schema

Micronaut supports various Swagger annotations to configure OpenAPI security. To enable API key authentication, use the @SecurityScheme annotation:

import io.swagger.v3.oas.annotations.security.SecurityScheme;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;

@SecurityScheme(
    name = "MyApiKey",
    type = SecuritySchemeType.APIKEY,
    in = SecuritySchemeIn.HEADER,
    paramName = "Authorization",
    description = "API Key authentication"
)

This defines an API key security scheme with the following properties:

  • Name: MyApiKey
  • Type: APIKEY
  • Location: Header (Authorization field)
  • Description: Explains how the API key authentication works

Applying the Security Scheme to OpenAPI

Next, we configure Swagger to use this authentication scheme by adding it to @OpenAPIDefinition:

import io.swagger.v3.oas.annotations.info.*;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;

@OpenAPIDefinition(
    info = @Info(
        title = "API",
        version = "1.0.0",
        description = "This is a well-documented API"
    ),
    security = @SecurityRequirement(name = "MyApiKey")
)

This ensures that the Swagger UI recognizes and applies the defined authentication method.

Conclusion

With these settings, your Swagger UI will display an Authorization field in the top-left corner.

Users can enter an API key, which will be automatically included in all API requests as a header.

This is just one way to implement authentication. The @SecurityScheme annotation also supports more advanced authentication flows like OAuth2, allowing seamless token-based authentication through a token provider.

By setting up API key authentication correctly, you enhance both the security and usability of your API documentation.

Surviving the “Big One” in IT – Part I

For every kind of natural disaster, there is a “Big One”. Everybody who lived through it remembers the time, everybody else has at least heard stories about it. Every time a similar natural disaster occurs, it gets compared to this one.

We just remembered the “Boxing Day Tsunami” twenty years ago. Another example might be “The Big One”, the devastating earthquake of San Francisco in 1906. From today’s viewpoint, it wasn’t the strongest earthquake since, but it was one of the first to be extensively covered by “modern” media. It preceded the Richter scale, so we can’t directly compare it to current events.

In the rather young history of IT, we had our fair share of “natural” disasters as well. We used to give the really bad ones nicknames. The first vulnerability that was equipped with a logo and its own domain was heartbleed in 2014, ten years ago.

Let’s name-drop some big incidents:

The first entry in this list is different from the others in that it was a “near miss”. It would have been a vertitable catastrophe with millions of potentially breached and compromised systems. It just got discovered and averted right before it would have been distributed worldwide.

Another thing we can deduce from the list is the number of incidents per year:

https://www.cve.org/about/Metrics

From around 5k published vulnerabilities per year until 2014 (roughly one every two hours) it rose to 20k in 2021 and 30k in 2024. That’s 80 reports per day or 4 per hour. A single human cannot keep up with these numbers. We need to rely on filters that block out the noise and highlight the relevant issues for us.

But let’s assume that the next “Big One” happens and attains our attention. There is one common characteristic for all incidents I witnessed that is similar to earthquakes or floods: It happens everywhere at once. Let me describe the situation at the example of Log4Shell:

The first reports indicated a major vulnerability in the log4j package. That seemed bad, but it was a logging module, what could possibly happen? We could lose the log files?

It soon became clear that the vulnerability can be used from a distance by just sending over a malicious request that gets logged. Like a web request without proper authentication to a route that doesn’t exist. That’s exactly what logging is for: Capturing the outliers and preserving them for review.

Right at the moment that it dawned on us that every system with any remote accessibility was at risk, the first reports of automated attacks emerged. It was now friday late evening, the weekend just started and you realized that you are in a race against bots. The last thing you can do is call it a week and relax for 2 days. In these 48 hours, the war is lost and the systems are compromised. You know that you have at most 4 hours to:

  • Gather a list of affected projects/systems
  • Assess the realistic risk based on current knowledge
  • Hand over concrete advice to the system’s admins
  • Or employ the countermeasures yourself

In our case, that meant to review nearly 50 projects, document the decision and communicate with the operators.

While we did that, during friday night, new information occurred that not only log4j 2.x, but also 1.x was susceptible to similar attacks.

We had to review our list and decisions based on the new situation. While we were doing that, somebody on the internet refuted the claim and proclaimed the 1.x versions safe.

We had to split our investigation into two scenarios that both got documented:

  • scenario 1: Only log4j 2.x is affected
  • scenario 2: All versions of log4j are vulnerable

We employed actions based on scenario 1 and held our breath that scenario 2 wouldn’t come true.

One system with log4j 1.x was deemed “low impact” if down, so we took it off the net as a precaution. Spoiler: scenario 2 was not true, so this was an unnecessary step in hindsight. But in the moment, it was one problem off the list, regardless of scenario validity.

The thing to recognize here is that the engagement with the subject is not linear and not fixed. The scope and details of the problem change while you work on it. Uncertainties arise and need to be taken into account. When you look back on your work, you’ll notice all the unnecessary actions that you did. They didn’t appear unnecessary in the moment or at least you weren’t sure.

After we completed our system review and had carried out all the necessary actions, we switched to “survey and communicate” mode. We monitored the internet talk about the vulnerability and stayed in contact with the admins that were online. I remember an e-mail from an admin that copied some excerpts from the server logfiles with the caption: “The attacks are here!”.

And that was the moment my heart sank, because we had totally forgotten about the second front: Our own systems!

Every e-mail is processed by our mailing infrastructure and one piece of it is the mail archive. And this system is written in Java. I raced to gather insights what specific libraries are used in it. Because if a log4j 2.x library were included, the friendly admin would have just inadvertently performed a real attack on our infrastructure.

A few minutes after I finished my review (and found a log4j 1.x library), the producer of the product sent an e-mail, validating my result by saying that the product is not at risk. But those 30 minutes of uncertainty were pure panic!

In case of an airplane emergency, they always tell you to make sure you are stable first (i.e. place your own oxygen mask first). The same thing can be said about IT vulnerabilities: Mind your own systems first! We would have secured our client’s systems and then fallen prey to friendly fire if the mail archive would have been vulnerable.

Let’s re-iterate the situation we will find ourselves in when the next “Big One” hits:

  • We need to compile a list of affected instances, both under our direct control (our own systems) and under our ministration.
  • We need to assess the impact of immediate shutdown. If feasible, we should take as many systems as possible out of the equation by stopping or airgapping them.
  • We need to evaluate the risk of each instance in relation to the vulnerability. These evaluations need to be prioritized and timeboxed, because they need to be performed as fast as possible.
  • We need to document our findings (for later revision) and communicate the decision or recommendation with the operators.

This situation is remarkably similar to real-world disaster mitigation:

  • The lists of instances are disaster plans
  • The shutdowns are like evacuations
  • The risk evaluation is essentially a triage task
  • The documentation and delegation phase is the command and control phase of disaster relief crews

This helps a lot to see which elements can be prepared beforehands!

The disaster plans are the most obvious element that can be constructed during quiet times. Because no disaster occurs according to plan and plans tend to get outdated quickly, they need to be intentionally fuzzy on some details.

The evacuation itself cannot be fully prepared, but it can be facilitated by plans and automation.

The triage cannot be prepared either, but supported by checklists and training.

The documentation and communication can be somewhat formalized, but will probably happen in a chaotic and unpredictable manner.

With this insight, we can look at possible ideas for preparation and planning in the next part of this blog series.