Quick revision
The short answer
A large company should rank its open source dependencies by usage and blast radius, not by size, which puts logging, serialization, HTTP and crypto libraries at the top. For those, it should prefer projects with active maintainers, security processes and small feature surfaces, turn off features it does not use, and keep the ability to replace or patch them through facades, BOMs, reproducible builds and in-house skill. It owes the critical projects real support, money, engineers' time and foundation membership, because free use without support is itself a supply chain risk that should be measured and reported like any other.
What to remember
In this answer, we saw that Log4Shell was a combination of ubiquity, an unneeded dangerous feature and an unsupported volunteer project. From that we derived a strategy: rank dependencies by usage and blast radius, choose critical libraries by project health and small feature surface and disable what we do not use, keep the ability to replace or patch them through facades, BOMs, reproducible builds and in-house skill, support the projects with money, time and foundation membership, and report supply chain risk to leadership with measurable targets.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
A large company should rank its open source dependencies by usage and blast radius, not by size, which puts logging, serialization, HTTP and crypto libraries at the top. For those, it should prefer projects with active maintainers, security processes and small feature surfaces, turn off features it does not use, and keep the ability to replace or patch them through facades, BOMs, reproducible builds and in-house skill. It owes the critical projects real support, money, engineers' time and foundation membership, because free use without support is itself a supply chain risk that should be measured and reported like any other.
Why this question is asked
Log4Shell was not caused by careless people. A small group of volunteers maintained a library that most of the industry relied on, and a little-used feature, lookups inside messages, turned out to be dangerous. The industry had taken the library for granted for years. Interviewers ask this question at the most senior levels because it moves the conversation from patching to strategy: how we choose what we depend on and what responsibility comes with that. In this answer, we will look at what Log4Shell teaches, how to find our critical dependencies, how to choose and configure them, how to keep the ability to replace or patch them, what we owe the projects, and how to report the risk.
1What Log4Shell Teaches
Three facts made Log4Shell so damaging. The library was everywhere, often pulled in transitively by libraries we chose for other reasons. The dangerous code was a feature very few users needed, so turning it off by default would have cost almost nobody anything. And the project was maintained by volunteers in their spare time, who then had to ship four security releases in three weeks under global pressure, while companies with billions in revenue filed demands for fixes.
So the lessons are about selection (which projects we trust), configuration (which features we leave enabled), control (whether we can fix or swap a library ourselves) and sustainability (whether the projects we rely on can respond). A senior engineer's job is to turn these into policy without stopping teams from using open source, which is one of the biggest productivity gains our industry has.
2Finding the Critical Dependencies by Blast Radius
Size and popularity are poor guides. A tiny library can be critical if it sits in every service and touches untrusted data. I would rank dependencies by two measures: usage, how many of our services and how many internet-facing services contain it, which the SBOM inventory tells us, and blast radius, what an attacker gains if it fails, which depends on whether the library parses or evaluates untrusted input and what privileges it runs with.
Ranked this way, the same families always come to the top: logging, serialization (JSON, XML, YAML), HTTP clients and servers, crypto and TLS, and authentication. That top list, perhaps 30 to 50 libraries, gets the extra care described below. The long tail gets normal hygiene: scanning and routine updates.
| Library family | Usage | Handles untrusted data? | Tier |
|---|---|---|---|
| Logging (SLF4J, Logback, Log4j2) | nearly every service | yes, logged input | critical |
| JSON and YAML parsing | nearly every service | yes, request bodies | critical |
| HTTP server and client | every web service | yes, requests | critical |
| Crypto and TLS | every service | yes, handshakes and tokens | critical |
| PDF report generation | 3 services | sometimes | standard |
| Test assertion libraries | all builds, not runtime | no | standard |
3Choosing and Configuring Critical Libraries
For a critical slot, we look at the health of the project before we adopt it, and again every year. Signals are several active maintainers rather than one, regular releases, a published security policy and a way to report vulnerabilities privately, fast responses to past CVEs, and scores such as the OpenSSF Scorecard. We also prefer libraries with small feature surfaces. A logging backend that formats and writes is safer than one that can also fetch objects over the network.
Then we configure for the minimum. Features we do not use are turned off explicitly: lookups and remote configuration in logging, polymorphic type handling in JSON libraries, external entity resolution in XML parsers. Each disabled feature is a whole class of future CVEs that cannot reach us. The shared configuration module from the platform team makes these settings the default for every service.
4Keeping the Ability to Replace or Patch
We must be able to act without waiting for anyone. Facades help: because our code uses the SLF4J API, we could swap the backend from Log4j2 to Logback without touching application code, which several companies did during Log4Shell. A company BOM lets us change a version in one place. Reproducible builds mean we can rebuild any service from source today and get the same result.
For the most critical libraries, we also keep the skill and the pipeline to build a patched version ourselves: check out the release tag, apply a fix or remove a class, build it, and publish it to our internal repository with a clear internal version such as 2.14.1-acme.1. We hope never to use it, but during an incident it turns a wait of days into hours.
- Upstream fix available?YesUpgrade through the company BOMNoCan we disable the feature?
- Can we disable the feature?configuration flag or remove a classYesDisable it, keep watching upstreamNoCan we swap behind the facade?
- Can we swap behind the facade?for example another SLF4J backendYesSwap the implementationNoBuild an internal patched release
- Contribute the fix upstreamso our patch does not become a fork
4 steps in order. Play them, or step through them one at a time.
5What We Owe the Projects
A company that builds its revenue on a library and gives nothing back is relying on volunteers' goodwill, and that goodwill can run out. Support is therefore not charity; it is risk management. Practical forms are money (sponsorship through GitHub Sponsors or Open Collective, or support contracts with companies that employ maintainers), engineers' time (paid time to fix bugs, review pull requests, improve tests and security tooling in projects on our critical list), and membership of foundations such as the Apache Software Foundation or OpenSSF, which fund security audits and tooling across many projects.
We also owe good behaviour: report vulnerabilities privately and with detail, do not demand fixes on a deadline from volunteers, and contribute our patches upstream instead of keeping private forks. I would set a budget, for example a fixed sum per year and a number of engineer-weeks, tied to the critical list.
6Reporting Supply Chain Risk to Leadership
Finally, this becomes part of how leadership sees risk. I would report it like availability or security risk, with numbers: the critical dependency list and the health of each project, time to know (how fast we can say which services contain a library, targeted at under an hour), time to patch critical CVEs across all services (targeted at a few days), the share of services that can be rebuilt today, and what we contributed upstream. Those numbers make the investment visible and show whether it is working.
7Follow-up questions
Would you ever fork a critical library? When?
Only as a short, temporary measure, or as a last resort. A temporary internal patch release is reasonable during an incident, or when upstream will not take a fix we need, and it should be contributed upstream at once so we can return to the official release. A long-term fork means we become the maintainers: every future security fix must be ported by us, forever. I would consider that only when the project is abandoned and nothing can replace it, and then I would rather fund or join a community fork than keep a private one.
How do you justify spending money on free software?
By comparing it with the cost of an incident. Log4Shell cost many companies weeks of engineering time across hundreds of people. A modest yearly sponsorship and some engineer time for the few projects that carry most of our risk is small next to that, and it buys faster fixes and influence over the project's direction.
Should we avoid small projects altogether?
No. Many excellent libraries are small. We should know which ones sit in critical places, check their health, and be ready to support or replace them.
8Conclusion
In this answer, we saw that Log4Shell was a combination of ubiquity, an unneeded dangerous feature and an unsupported volunteer project. From that we derived a strategy: rank dependencies by usage and blast radius, choose critical libraries by project health and small feature surface and disable what we do not use, keep the ability to replace or patch them through facades, BOMs, reproducible builds and in-house skill, support the projects with money, time and foundation membership, and report supply chain risk to leadership with measurable targets.
Open with
I would start by being honest about Log4Shell: the volunteers did nothing unusual, the industry simply relied on a library nobody funded, and a rarely used feature evaluated logged data.
Then, if they want more
So my approach has four parts. First, identify critical dependencies by usage and blast radius, not size. From our SBOM inventory we see which libraries are in most services and which touch untrusted input, and logging, serialization, HTTP and crypto always come to the top. That list gets extra care.
Second, choose and configure carefully: prefer projects with several active maintainers, a security policy and a good record on past CVEs, prefer small feature surfaces, and switch off features we do not use, like lookups in logging or default typing in JSON.
Third, keep control: use facades like SLF4J so we can swap a backend, pin versions in a company BOM, keep builds reproducible, and keep the skill to build an internal patched release in hours if we must, contributing the fix upstream.
Fourth, give back, because free use without support is a supply chain risk: sponsorship, paid engineer time on critical projects, and foundation membership such as OpenSSF. Then I report it to leadership like any operational risk, with targets such as knowing within an hour where a library is and patching critical issues everywhere within days.
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 "Log4Shell was a feature (lookups) that few users needed, inside a volunteer-maintained...": https://scrivio-interview-library.netlify.app/java/java-logging/aefe3d4f96/