{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2026-105768",
        "assignerOrgId": "82cea9a6-e9e3-46fe-bdb0-3673de380178",
        "state": "PUBLISHED",
        "assignerShortName": "chainguard",
        "dateReserved": "2026-10-05T19:21:04.930Z",
        "datePublished": "2026-10-05T20:17:46.477Z",
        "dateUpdated": "2026-10-05T20:17:46.477Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "82cea9a6-e9e3-46fe-bdb0-3673de380178",
                "shortName": "chainguard",
                "dateUpdated": "2026-10-05T20:17:46.477Z"
            },
            "title": "apko /etc/passwd and /etc/group UID/GID truncation writes package-supplied entries as root",
            "datePublic": "2026-09-23T22:40:00.000Z",
            "problemTypes": [
                {
                    "descriptions": [
                        {
                            "lang": "en",
                            "cweId": "CWE-197",
                            "description": "CWE-197 Numeric Truncation Error",
                            "type": "CWE"
                        }
                    ]
                }
            ],
            "impacts": [
                {
                    "capecId": "CAPEC-128",
                    "descriptions": [
                        {
                            "lang": "en",
                            "value": "CAPEC-128 Integer Attacks"
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "vendor": "chainguard-dev",
                    "product": "apko",
                    "collectionURL": "https://pkg.go.dev",
                    "packageName": "chainguard.dev/apko",
                    "repo": "https://github.com/chainguard-dev/apko",
                    "modules": [
                        "pkg/passwd"
                    ],
                    "programFiles": [
                        "pkg/passwd/passwd.go",
                        "pkg/passwd/group.go"
                    ],
                    "programRoutines": [
                        {
                            "name": "passwd.UserEntry.Parse"
                        },
                        {
                            "name": "passwd.GroupEntry.Parse"
                        }
                    ],
                    "versions": [
                        {
                            "status": "affected",
                            "version": "0.2.0",
                            "lessThan": "1.4.5",
                            "versionType": "semver"
                        }
                    ],
                    "defaultStatus": "unaffected"
                }
            ],
            "descriptions": [
                {
                    "lang": "en",
                    "value": "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.",
                    "supportingMedia": [
                        {
                            "type": "text/html",
                            "base64": false,
                            "value": "<p>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, <code>UserEntry.Parse</code> and <code>GroupEntry.Parse</code> in <code>pkg/passwd</code> read the UID and GID fields of <code>/etc/passwd</code> and <code>/etc/group</code> entries with <code>strconv.Atoi</code> and convert them to <code>uint32</code> without a range check. On 64-bit platforms an out-of-range value such as <code>4294967296</code> (2^32) is truncated to <code>0</code>, 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.</p>"
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://github.com/chainguard-dev/apko/security/advisories/GHSA-rj6x-hwpv-vhvf",
                    "name": "GHSA-rj6x-hwpv-vhvf",
                    "tags": [
                        "vendor-advisory"
                    ]
                },
                {
                    "url": "https://github.com/chainguard-dev/apko/pull/2516",
                    "name": "chainguard-dev/apko#2516",
                    "tags": [
                        "patch"
                    ]
                },
                {
                    "url": "https://github.com/chainguard-dev/apko/commit/739e7ce3f675ffb232e16849b51ff93657f1570c",
                    "name": "Fix commit 739e7ce",
                    "tags": [
                        "patch"
                    ]
                },
                {
                    "url": "https://github.com/chainguard-dev/apko/releases/tag/v1.4.5",
                    "name": "apko v1.4.5",
                    "tags": [
                        "release-notes"
                    ]
                }
            ],
            "metrics": [
                {
                    "format": "CVSS",
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "GENERAL"
                        }
                    ],
                    "cvssV4_0": {
                        "attackVector": "NETWORK",
                        "attackComplexity": "LOW",
                        "attackRequirements": "PRESENT",
                        "privilegesRequired": "NONE",
                        "userInteraction": "NONE",
                        "vulnConfidentialityImpact": "NONE",
                        "subConfidentialityImpact": "NONE",
                        "vulnIntegrityImpact": "LOW",
                        "subIntegrityImpact": "LOW",
                        "vulnAvailabilityImpact": "NONE",
                        "subAvailabilityImpact": "NONE",
                        "exploitMaturity": "NOT_DEFINED",
                        "Safety": "NOT_DEFINED",
                        "Automatable": "NOT_DEFINED",
                        "Recovery": "NOT_DEFINED",
                        "valueDensity": "NOT_DEFINED",
                        "vulnerabilityResponseEffort": "NOT_DEFINED",
                        "providerUrgency": "NOT_DEFINED",
                        "version": "4.0",
                        "baseSeverity": "MEDIUM",
                        "baseScore": 6.3,
                        "vectorString": "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"
                    }
                }
            ],
            "configurations": [
                {
                    "lang": "en",
                    "value": "apko runs on a 64-bit platform and installs a package that supplies /etc/passwd or /etc/group entries with an out-of-range UID or GID.",
                    "supportingMedia": [
                        {
                            "type": "text/html",
                            "base64": false,
                            "value": "<p>apko runs on a 64-bit platform and installs a package that supplies <code>/etc/passwd</code> or <code>/etc/group</code> entries with an out-of-range UID or GID.</p>"
                        }
                    ]
                }
            ],
            "solutions": [
                {
                    "lang": "en",
                    "value": "Upgrade to apko 1.4.5 or later, which rejects UID and GID values outside 0 to 4294967295 instead of truncating them. Images built with earlier versions from untrusted packages should be rebuilt.",
                    "supportingMedia": [
                        {
                            "type": "text/html",
                            "base64": false,
                            "value": "<p>Upgrade to apko 1.4.5 or later, which rejects UID and GID values outside 0 to 4294967295 instead of truncating them. Images built with earlier versions from untrusted packages should be rebuilt.</p>"
                        }
                    ]
                }
            ],
            "timeline": [
                {
                    "time": "2022-03-03T23:21:00.000Z",
                    "lang": "en",
                    "value": "Truncating uint32 conversion introduced"
                },
                {
                    "time": "2026-09-21T22:49:00.000Z",
                    "lang": "en",
                    "value": "Fix merged (chainguard-dev/apko#2516)"
                },
                {
                    "time": "2026-09-23T22:40:00.000Z",
                    "lang": "en",
                    "value": "GHSA-rj6x-hwpv-vhvf published"
                },
                {
                    "time": "2026-09-28T00:51:00.000Z",
                    "lang": "en",
                    "value": "apko v1.4.5 released"
                }
            ],
            "credits": [
                {
                    "lang": "en",
                    "value": "Fernando (https://github.com/fthomasella)",
                    "type": "reporter"
                },
                {
                    "lang": "en",
                    "value": "Jorge Lucangeli Obes (https://github.com/jlucangelio)",
                    "type": "remediation developer"
                },
                {
                    "lang": "en",
                    "value": "Steve Beattie (https://github.com/stevebeattie)",
                    "type": "remediation reviewer"
                },
                {
                    "lang": "en",
                    "value": "SunnyR (https://github.com/SunnyR)",
                    "type": "coordinator"
                },
                {
                    "lang": "en",
                    "value": "Chainguard (https://chainguard.dev)",
                    "type": "coordinator"
                }
            ],
            "source": {
                "advisory": "GHSA-rj6x-hwpv-vhvf",
                "discovery": "EXTERNAL"
            },
            "x_generator": {
                "engine": "Vulnogram 1.0.5"
            }
        }
    }
}