# CVE-2026-105768: apko /etc/passwd and /etc/group UID/GID truncation writes package-supplied entries as root

> Attackers can force package-supplied entries to run as root by exploiting UID/GID truncation in apko, leading to privilege escalation in built images.

- **Severity:** Medium 6.3 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 5 Oct 2026
- **Updated:** 6 Oct 2026
- **Also known as:** GHSA-rj6x-hwpv-vhvf

## What is CVE-2026-105768?

CVE-2026-105768 is a medium-severity vulnerability in chainguard-dev apko, published on 5 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-197 (Numeric Truncation Error)

## Which versions are affected by CVE-2026-105768?


## How do I fix CVE-2026-105768?

No fix has been published for CVE-2026-105768 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-105768 being exploited?

There is no known exploitation of CVE-2026-105768 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-105768 and fix it if it is affected.

What it is: CVE-2026-105768 is a medium-severity vulnerability in chainguard-dev apko, published on 5 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-105768 in the wild and no public exploit code.

Affected product: chainguard-dev apko. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-105768/ (Markdown: https://insights.sbomify.com/CVE-2026-105768/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-105768
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-105768
- OSV: https://osv.dev/vulnerability/CVE-2026-105768

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-105768/
Summaries are generated and may contain mistakes; the official description above is the record.
