Skip to content

Bug: image references with a registry port or an @sha256: digest are split into the wrong name and tag #587

Closed

Description

@vibgrate-team

Context

parseDockerImage in src/core-open/scanners/docker-cache.ts does imageRef.split(':') and takes the first two parts. That breaks two common forms:

  • localhost:5000/team/app:1.2.3 gives image localhost and tag 5000/team/app.
  • node:20@sha256:4c2e... gives tag 20@sha256, and node@sha256:4c2e... gives image node@sha256.

The scan then shows nonsense names or unknown drift for pinned images, which are exactly the ones teams care most about.

What to do

  • Split the digest off first (@sha256:...), then take the tag from the last : that comes after the last /.
  • Keep the digest available on the parsed ref (tag stays the human version when both are present).
  • Add table-driven unit tests for parseDockerImage.

Acceptance

  • localhost:5000/team/app:1.2.3 parses to registry localhost:5000, image team/app (or namespace team, image app), tag 1.2.3.
  • node:20@sha256:... parses to tag 20 plus the digest; node@sha256:... parses to image node with no tag.
  • Existing simple forms (nginx, nginx:1.27, bitnami/redis:7) are unchanged.

Activity

  1. added
    bug
    on Nov 4, 2026
  2. vibgrate-team commented on Nov 4, 2026

    @vibgrate-team
    ContributorAuthor

    Confirmed: parseDockerImage in src/core-open/scanners/docker-cache.ts starts with const [imagePart, tagPart] = imageRef.split(':'), which breaks on host:port registries and @sha256: digests.

    Order matters here: split off @... first, then find the tag as the text after the last : only if that : comes after the last /, then do the existing registry check on the first path segment (a : in it also marks a registry, as with localhost:5000). A table-driven test covering the existing simple forms will guard against regressions in everything that calls it.

  3. added a commit that references this issue on Nov 5, 2026
    492495c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions