Scrivio Interview library
ScenarioIntermediate7 min read · updated 12 November 2026

A new critical CVE in a logging library is announced on a Friday. You run 150 Java services, some with shaded or fat jars, some third-party vendor products. Describe your first 48 hours.

In the first 48 hours we find every place the library lives, including shaded copies and vendor products, using build SBOMs, dependency scanners and file scans of running images. We rank services by exposure, apply partial mitigations where a patch will take time, and patch the rest by forcing the fixed version through dependency management and redeploying through the normal pipeline. In parallel we contact vendors, isolate what cannot be patched, hunt for signs of exploitation, rotate exposed secrets and keep one tracker that leadership can read.

Why this question is asked

A critical CVE in a logging library is not like an ordinary bug. Logging is in every service, often several times over, and attackers start scanning within hours of the announcement. Interviewers ask this scenario to see whether we can run an incident calmly: know where the code is, decide what to fix first, fix it safely, and prove we were not already compromised. In this answer, we will walk through the first 48 hours in the order I would run them: organising the response, building the inventory, ranking risk, mitigating, patching, handling vendors, and checking for exploitation, using Log4Shell as the worked example.

1Hour 0 to 2: Organise Before Touching Anything

The first step is not technical. We open an incident with a named incident lead, a security lead and one engineer per platform area, a single chat channel and a single tracker. The tracker is a table with one row per service: owner, whether it contains the library, which version, exposure, mitigation status, patch status and evidence. Every later step writes into it, and leadership reads it instead of interrupting the engineers.

We also read the advisory carefully and write a one-page summary: which artifact is vulnerable (for Log4Shell it was log4j-core, not log4j-api), which versions, which configurations, what an attack looks like and what the vendor recommends. Many hours were wasted in December 2021 by teams patching jars that were never vulnerable while missing the ones that were.

The incident tracker, one row per service
ServiceContains it?ExposureMitigatedPatched
checkout-apilog4j-core 2.14.1internet, logs headersJndiLookup removed, hour 62.17.1, hour 20
report-batchshaded copy in a fat jarinternal onlynot neededrebuild, hour 30
vendor-crmunknowninternal, user inputnetwork isolatedwaiting for vendor
pricing-svclog4j-api onlyinternetnot affectedno change
Leadership reads the tracker, not the engineers' channel.

2Hour 1 to 8: Build the Inventory

With 150 services we cannot ask each team and wait. We use three sources and combine them. First, SBOMs (software bills of materials, lists of every component in a build) generated by the build in CycloneDX or SPDX format and stored centrally; a query over them answers "which builds contain log4j-core below 2.17.1" in minutes. Second, dependency scanners such as OWASP Dependency-Check, Snyk or GitHub's dependency graph, which also catch repositories without SBOMs. Third, file scans of the running containers and hosts, because what runs is what matters and builds do not always match production.

The file scan must look inside archives. A fat jar or a shaded library copies classes into its own jar, sometimes under a renamed package, so searching for a file called log4j-core.jar misses it. For Log4Shell we searched for the class itself, JndiLookup.class, inside jars, nested jars and wars.

Java
# Scan a running image's file system for jars, including nested ones, that contain the class
find / -name "*.jar" -o -name "*.war" 2>/dev/null | while read f; do
unzip -l "$f" 2>/dev/null | grep -q "core/lookup/JndiLookup.class" && echo "FOUND: $f"
done
# FOUND: /app/lib/report-batch-all.jar <- a shaded copy no SBOM listed

Notice that this simple loop does not open jars nested inside jars; dedicated scanners published during the incident did, and it is worth using one. Every hit goes into the tracker with its version, and every service with no data is marked unknown, never assumed safe.

3Hour 2 to 12: Rank by Exposure and Mitigate

We cannot patch 150 services at once, so we rank them. Internet-facing services that log user input come first, because they are reachable by the scanning attackers and their logs see attacker text. Internal services that log data from users or partners come next. Batch jobs that only log their own data come last.

Where a patch will take hours or days, we apply mitigations, knowing they are partial. For Log4Shell those were WAF rules for the known strings, which attackers evaded with nested lookups; the formatMsgNoLookups flag, which did not cover every case; and removing the JndiLookup class from the jar, which was the strongest stopgap. Blocking outbound connections from servers to the internet also broke the exploit chain, because the server could no longer reach the attacker's LDAP server.

Step throughDeciding the order of work for each service
  1. Contains the vulnerable artifact?from SBOM, scanner or file scan
    YesRank by exposureNoRecord as not affected
  2. Internet-facing and logs user input?
    YesMitigate now, patch firstNoPatch in normal order
  3. Can it be patched within hours?
    YesPatch and redeployNoMitigate: remove class, block egress, WAF
  4. Verify in productionscan the running image again

4 steps in order. Play them, or step through them one at a time.

4Hour 4 to 36: Patch Through the Normal Pipeline

The real fix is upgrading the library. Because the vulnerable jar often arrives transitively, through another library, we force the version centrally. In Maven we put the fixed version in dependencyManagement, preferably by importing the project's BOM (bill of materials, a pom that pins a group of versions); in Gradle we use a platform or a constraint. Spring Boot projects can simply set the managed property.

XML
<!-- Maven: every module, every transitive path gets the fixed version -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.17.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Spring Boot alternative: <properties><log4j2.version>2.17.1</log4j2.version></properties> -->

Then we rebuild and redeploy through the normal pipeline, with tests, but with a fast approval path agreed for the incident. Skipping the pipeline to hot-patch servers by hand feels faster but creates servers whose state nobody knows. Shaded copies need the owning project to rebuild with the new version, so those teams are told early. After each deploy we scan the running image again and only then mark the row as patched.

5In Parallel: Vendors, Exploitation and Secrets

Vendor products are the slowest part, because we cannot rebuild them. We contact each vendor for their advisory and status, apply their recommended mitigation, and where there is no answer we isolate the system: restrict its inbound access to the people who need it and block its outbound internet access. The tracker shows these rows clearly so that nobody mistakes "waiting for vendor" for "done".

We also assume we may already have been attacked, because scanning started before many teams even read the advisory. The security team searches logs, WAF records and DNS logs for indicators such as ${jndi: strings and their obfuscated forms, and checks egress traffic for unexpected LDAP, RMI or DNS requests from servers. If a service was exposed and vulnerable, we rotate the secrets it could read, such as database passwords and cloud keys, because an attacker could have exfiltrated them through a lookup. Twice a day the incident lead sends leadership a short summary from the tracker: how many services are affected, mitigated, patched and unknown.

6Follow-up questions

What would you change afterwards so the next response is faster?

Most of the 48 hours went into finding the library, so I would make that a query: SBOMs generated for every build and every deployed image, stored centrally and searchable. I would put shared libraries under a company BOM so one version change reaches every service, keep automated dependency update PRs flowing so upgrading is routine, make sure every service can be rebuilt and deployed within a day, and restrict outbound network access by default. I would also write the incident playbook down and rehearse it once a year with a made-up CVE.

Why not just patch everything first and inventory later?

Because without an inventory we do not know when we are finished. The services we do not know about, a shaded copy or a forgotten batch job, are the ones that get exploited. The inventory is also what lets us put the risky services first.

How do you handle a team that says their service is not affected?

I ask for the evidence that goes into the tracker: the scan of the running image or the dependency tree. Feelings are not evidence, and shaded copies surprise even careful teams.

7Conclusion

In this answer, we walked through the first 48 hours of a critical logging CVE: organise one incident with a tracker, build the inventory from SBOMs, scanners and file scans that look inside fat and shaded jars, rank by exposure, apply partial mitigations where patching takes time, patch by forcing the fixed version through dependency management and the normal pipeline, isolate vendor systems, hunt for exploitation and rotate exposed secrets. The same plan, written down and rehearsed, makes the next response faster.

What to say in the interviewAbout 90 seconds aloud

Open with

First I would set up the incident properly: one lead, one channel, and one tracker with a row per service showing whether it contains the library, the version, exposure, mitigation and patch status.

Then, if they want more

Then the inventory. I would query our SBOMs, the CycloneDX or SPDX files from each build, run dependency scanners over the repositories, and scan the file systems of running containers, looking inside jars for the vulnerable class itself, because fat jars and shaded copies do not show the artifact name. For Log4Shell that meant searching for JndiLookup.class.

Unknown services stay marked unknown. Next I rank: internet-facing services that log user input first. Where patching takes time I apply mitigations knowing they are partial, such as WAF rules, configuration flags, removing the vulnerable class from the jar, and blocking outbound traffic.

The real fix is upgrading, forced centrally with the library's BOM in dependency management so transitive copies are covered, then rebuild and redeploy through the normal pipeline with a fast approval, and scan the running image again.

In parallel I contact vendors and isolate their products until they patch, the security team searches logs and egress traffic for indicators of exploitation, and we rotate secrets on any exposed vulnerable service. Leadership gets a summary from the tracker twice a day.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "A new critical CVE in a logging library is announced on a Friday. You run 150 Java...": https://scrivio-interview-library.netlify.app/java/java-logging/f2659e35c0/