Safeguard
Security Guides•

How do I scan a built JAR or Java container image without the source?

With only a JAR, WAR or container image, scan the artifact itself. What to look for in Spring Boot, shaded and WAR layouts, and where scanners fall short.

Safeguard Security Team
3 min read

Scan the artifact itself: unpack the JAR or WAR and list the libraries inside, or scan the container image layers. This works when you have no source, such as vendor software or old builds. Expect gaps with shaded libraries, so treat the result as a floor, not a full list.

When you need this

  • A vendor hands you a JAR or WAR.
  • A legacy service has no repository anyone can find.
  • A build produced an image and the pipeline logs are gone.
  • A critical CVE lands and you must check what is deployed, not what is in Git.

What the three common layouts look like

ArtifactWhere libraries areVisibility to a scanner
Spring Boot executable JARNested jars in BOOT-INF/libGood, names stay visible
WARWEB-INF/lib, and WEB-INF/lib-provided for embedded-onlyGood
Shaded or uber JARClasses merged, packages possibly renamedWeak, see shaded JARs

The Spring Boot documentation describes the first two layouts. The Shade plugin documentation describes why the third is harder: bundled dependencies are removed from the generated POM, and packages may be relocated.

Steps

  1. Identify the packaging. Look at META-INF/MANIFEST.MF and the folders.
  2. List nested jars with unzip -l and note names and versions.
  3. Check for duplicates. Two versions of one library suggest a conflict or a hidden bundle.
  4. For images, scan each layer, since a Boot image can separate a dependencies layer from application code. The layer index file layers.idx records that grouping.
  5. Record the runtime too. The JDK and the container base image have their own findings.
  6. Save the output as an inventory and rescan on new advisories.

Limits you should state to your team

  • A nested jar name can be changed. Do not treat file names as proof.
  • Shaded copies can hide libraries.
  • Native libraries and code loaded at runtime from elsewhere are outside a static listing.
  • A listing says what is present, not what the application calls. Use reachability to prioritise, see Is a vulnerable Java dependency actually reachable?.

Try it yourself

Click through it at your own pace, or open it full screen.

Watch how an image is broken into packages and how findings are attached to each one.

Where Safeguard fits

Safeguard scans container images and dependencies and produces SBOMs for what it finds. You can try a free scan to see what it reports.

Quick check

Can I trust file names inside a jar?

Treat them as strong hints, not proof. Names can be changed, and shaded libraries may not appear as jars at all.

Does a clean artifact scan mean the software is safe?

No. It means the scanner found no known issue in what it could see.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.