Skip to content
Heist/ feed
Medium

apko /etc/passwd and /etc/group UID/GID truncation writes package-supplied entries as root

Type: advisorySource: Official CVE List1 source record

apko allows users to build and publish OCI container images built from apk packages. From version 0.2.0 to before version 1.4.5, UserEntry.Parse and GroupEntry.Parse in pkg/passwd read the UID and GID fields of /etc/passwd and /etc/group entries with strconv.Atoi and convert them to uint32 without a range check. On 64-bit platforms an out-of-range value such as 4294967296 (2^32) is truncated to 0, and negative values wrap. Because apko parses the passwd and group entries supplied by the packages it installs and writes them back into the image, an attacker who controls a package installed into the image can ship an entry that appears to declare an unprivileged UID or GID but is written into the built image as UID 0 or GID 0 (root). The truncated UID is also used when resolving the image's run-as user. This issue has been fixed in version 1.4.5.

Announced Source revision 1
Original source ↗

CVE-2026-105768

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2026-105768

apko

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "repo": "https://github.com/chainguard-dev/apko",
    "vendor": "chainguard-dev",
    "modules": [
      "pkg/passwd"
    ],
    "product": "apko",
    "versions": [
      {
        "status": "affected",
        "version": "0.2.0",
        "lessThan": "1.4.5",
        "versionType": "semver"
      }
    ],
    "packageName": "chainguard.dev/apko",
    "programFiles": [
      "pkg/passwd/passwd.go",
      "pkg/passwd/group.go"
    ],
    "collectionURL": "https://pkg.go.dev",
    "defaultStatus": "unaffected",
    "programRoutines": [
      {
        "name": "passwd.UserEntry.Parse"
      },
      {
        "name": "passwd.GroupEntry.Parse"
      }
    ]
  }
]
Related CVEs
CVE-2026-105768

Source reference: /cveMetadata/cveId

Publisher severity

medium

Source reference: /containers/cna/metrics

Event
#9299 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement