Scrivio Interview library
ScenarioIntermediate7 min read · updated 12 November 2026

A security team asks how many of your services include a specific vulnerable version of log4j-core, mostly through transitive paths. How do you answer within hours, and what would make it faster next time?

The fastest answer comes from SBOMs or a dependency inventory: if every build stored a list of its components, one query for log4j-core at the vulnerable versions returns the affected services within minutes. Without that, we scan the artifact repository and the deployed container images with a scanner that opens jars, including jars nested inside fat jars, because source-level dependency trees miss shaded and copied jars. To be faster next time, we generate and store an SBOM for every build, link it to what is deployed, and keep a runbook for fleet-wide upgrades through the platform BOM.

Why this question is asked

In December 2021, Log4Shell turned this exact question into a race for nearly every company running Java. The companies that answered in an hour already knew what they were running; the rest spent days grepping repositories and still found surprises weeks later. Interviewers ask this scenario because it tests whether we know the difference between what we declared and what we actually deployed, and whether we can turn a fire drill into a process. In this answer, we will see why the question is harder than it looks, walk through the fast path with SBOMs, the fallback path with scanners, why source trees are not enough, and what we would put in place afterwards.

1Why the Question Is Harder Than It Looks

The question is not which repositories mention log4j-core. It is which running services contain a vulnerable copy. Those are different because of how jars travel. Most services never declare log4j-core; it arrives transitively through some other library. Some services shade a library that contains it, so the classes are renamed or copied into another jar. Some container images include a vendor tool or an agent with its own copy. And some repositories have changed since the version that is currently deployed.

So we need two facts per service: which artifact version is deployed where, and what that artifact actually contains. Anything that answers only from source code answers a different question.

2The Fast Path: Query the SBOMs

An SBOM, a software bill of materials, is a machine-readable list of every component inside an artifact, with versions and usually hashes. If our builds already produce one, typically in CycloneDX format, and store it in a system such as OWASP Dependency-Track, the answer is one search: component log4j-core, versions in the vulnerable range. Dependency-Track shows every project version that contains it. If we also record which artifact versions are deployed in which environment, we can intersect the two and know exactly what is exposed in production.

This is why the first thing we say to the security team is what we have. If an inventory exists, we can give a first list in under an hour, with a confidence statement about which services are not covered by SBOMs yet.

Step throughAnswering within hours
  1. SBOMs or an inventory exist?
    Yesquery component and version rangeNoscan repositories and images
  2. Scan the artifact repository and deployed imagesuse a scanner that opens nested jars
  3. Map artifacts to running servicesdeployment records, image tags, cluster inventory
  4. Report affected, not affected and unknownunknown is a list with owners, not a footnote
  5. Patch through the platform BOM, then rescanconfirm the vulnerable version is gone

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

3The Fallback: Scan What Is Deployed

Without SBOMs, we scan artifacts rather than source. Two places matter. The artifact repository (Nexus or Artifactory) holds every released jar, and some repository managers can search their own contents or integrate with a scanner. More important are the container images that are actually running, which we can list from the cluster and scan with a tool that understands Java. Trivy and Grype both open jar files, look inside nested jars such as BOOT-INF/lib in a Spring Boot jar, and identify components from their embedded Maven metadata.

Java
# Which images are running right now?
kubectl get pods -A -o jsonpath='{range .items[*]}{.spec.containers[*].image}{"\n"}{end}' | sort -u > images.txt
# Scan each one for the specific vulnerability
while read img; do
trivy image --quiet --scanners vuln --format json "$img" \
| jq -r --arg img "$img" '.Results[]?.Vulnerabilities[]? | select(.PkgName | test("log4j-core")) | "\($img) \(.InstalledVersion) \(.PkgPath)"'
done < images.txt
# registry.acme/orders:4.2.1 2.14.1 app/app.jar/BOOT-INF/lib/log4j-core-2.14.1.jar
# registry.acme/reports:1.9.0 2.11.0 opt/vendor-agent/lib/log4j-core-2.11.0.jar

Notice the second line of the result: the vulnerable copy in the reports image comes from a vendor agent, not from the service's own build. No dependency tree of the reports repository would have shown it. For anything a scanner cannot identify, such as a jar stripped of its metadata, a simple search for the class file that contains the vulnerability, for example JndiLookup.class in the Log4Shell case, is a useful last check.

4Why Source-Level Dependency Trees Are Not Enough

Running mvn dependency:tree across every repository is a tempting first idea, and it is a fine supplement, but it misses several things. It shows the current branch, not the deployed version. It does not see shaded or relocated copies inside other jars, because the tree only knows declared coordinates. It does not see jars added in a Dockerfile, provided by an application server, or bundled inside agents and tools in the image. And it depends on every repository building cleanly, which old repositories often do not.

So we use dependency trees to plan the fix, which is a source change, and scans of artifacts to decide exposure, which is a property of what runs.

5Making It Faster Next Time

After the incident, the lesson is to have the inventory ready before we need it. Every build generates an SBOM from the resolved artifacts, with the CycloneDX Maven or Gradle plugin for the application and an image-level SBOM from a tool such as Syft for the container. The SBOM is stored next to the artifact and uploaded to an index such as Dependency-Track. The deployment pipeline records which artifact version went to which environment, so the index knows what is running, not just what was built.

The second lesson is a runbook for the fix. Most services get log4j-core through a managed version, so the platform team raises it once in the company's platform BOM (with Spring Boot, the log4j2.version property), releases the BOM, and automated pull requests upgrade every service. The runbook names who does each step, how services without active owners are handled, and how we verify with a rescan. Then we rehearse it once or twice a year with a harmless library, so that the next real incident starts from a practised routine.

6Follow-up questions

How do you handle services that nobody owns?

They show up as the unknown or slow part of the report, which is useful in itself. In the incident we assign them temporarily to the platform team or the team closest to them and patch through the BOM or by rebuilding the image. Afterwards, we make ownership a deployment requirement: a service without an owner in the catalogue cannot be deployed, and orphans get an owner or get retired.

What if the vulnerable library cannot be upgraded quickly?

We look for mitigations that buy time: configuration flags or system properties that disable the vulnerable feature, removing the vulnerable class from the jar as was done with JndiLookup for Log4Shell, network rules that block the exploit path, or WAF rules. These are temporary and tracked, and we still upgrade as soon as a fixed version is usable.

Can a runtime agent help answer this question?

Yes. Some observability and security tools report the libraries loaded by each running JVM, which shows what is really in memory, including copies loaded by agents. That is a strong complement to SBOMs, because it reflects the running process. But it only covers services with the agent installed, so it does not replace build-time inventory.

7Conclusion

In this answer, we saw that the real question is what is deployed, not what is declared. With SBOMs stored and linked to deployments, one query answers it within minutes; without them, we scan the artifact repository and running images with a scanner that inspects nested jars, because shaded jars, vendor agents and Dockerfile copies are invisible to source trees. To be faster next time we generate an SBOM for every build, link it to deployments, index it, and keep a rehearsed runbook for fleet-wide upgrades through the platform BOM.

What to say in the interviewAbout 80 seconds aloud

Open with

I would first tell the security team what data we have and how complete it is. If our builds produce SBOMs and they are indexed, for example in Dependency-Track, I query log4j-core in the vulnerable version range and intersect the result with deployment records, which gives a first list in under an hour.

Then, if they want more

If we do not have that, I scan what is actually deployed rather than source code: list the images running in our clusters and scan each with Trivy or Grype, which open jars including nested ones under BOOT-INF/lib, and scan the artifact repository too.

Source dependency trees are not enough, because they show the current branch rather than the deployed version and they miss shaded copies, vendor agents and jars added in Dockerfiles. I would report affected, not affected and unknown, with owners for the unknowns.

For the fix, I would raise the version once in the platform BOM and let automated pull requests roll it out, then rescan. To be faster next time, every build would generate and store an SBOM linked to its deployments, and we would keep and rehearse a runbook for fleet-wide upgrades.

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 documentation below. 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 security team asks how many of your services include a specific vulnerable version of...": https://scrivio-interview-library.netlify.app/java/dependency-and-supply-chain/b2629b1d65/