---
title: "Base-image advice"
description: "How TRUSTIVAN splits a container image's vulnerabilities between its base image and your own layers, and suggests a same-family tag with fewer."
---

Most of a container image's vulnerabilities usually arrive with its base
image, and the cheapest fix is often a different base tag rather than a
package-by-package upgrade. The **Base image** card on a container image's
asset page (and `GET /api/v1/assets/{id}/base-image`) answers two questions.

## How much came with the base image

Each vulnerability finding records `detail.in_base_image`: whether the
vulnerable package arrived in a layer the image inherited. The card counts
the image's open vulnerability findings three ways: **base image**, **your
layers**, and **unknown** (scanned before this was recorded; the next scan
attributes them).

**Method.** The boundary is the image history up to its last `CMD`
instruction, the same heuristic the scanning engine uses for its own
base-layer handling: a base image ends with a `CMD`, and everything after it
is yours. The base image is *named* only when the image carries the
`org.opencontainers.image.base.name` label (for example `LABEL
org.opencontainers.image.base.name=docker.io/library/node:20-bookworm`, or
`docker buildx build --annotation` with the same key).

## Which tag would carry fewer

The card lists up to three other tags with fewer open vulnerabilities, from
the same image repository and operating-system family (Debian stays Debian,
Alpine stays Alpine):

- When the image names its base, the family is the base image's repository,
  and the bar to beat is what the image inherited from it (or the base
  image's own backlog, if you have scanned that exact tag).
- When it does not, the family is the image's own repository (other tags of
  it), and the bar is its whole backlog.

## Limits

- **Only images you have scanned.** No registry is queried, so a newer tag
  nobody in your organization has scanned is never suggested, and a
  suggestion is only as current as its last scan. Scan a candidate tag to
  compare it.
- **The boundary is a heuristic.** A multi-stage build, or a base image built
  without a final `CMD`, can move or hide it. With no boundary in the
  history, the card says so and splits nothing.
- **An unlabelled base is not named.** Without the label, TRUSTIVAN can
  attribute findings to the inherited layers but cannot name the image to
  replace.
