CVE-2026-105768 (GCVE-0-2026-105768)
Vulnerability from cvelistv5
Published
2026-10-05 20:17
Modified
2026-10-06 13:59
CWE
  • CWE-197 - Numeric Truncation Error
Summary
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.
Impacted products
Vendor Product Version
chainguard-dev apko Version: 0.2.0   ≤
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2026-105768",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2026-10-06T13:59:21.787962Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2026-10-06T13:59:32.353Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "collectionURL": "https://pkg.go.dev",
          "defaultStatus": "unaffected",
          "modules": [
            "pkg/passwd"
          ],
          "packageName": "chainguard.dev/apko",
          "product": "apko",
          "programFiles": [
            "pkg/passwd/passwd.go",
            "pkg/passwd/group.go"
          ],
          "programRoutines": [
            {
              "name": "passwd.UserEntry.Parse"
            },
            {
              "name": "passwd.GroupEntry.Parse"
            }
          ],
          "repo": "https://github.com/chainguard-dev/apko",
          "vendor": "chainguard-dev",
          "versions": [
            {
              "lessThan": "1.4.5",
              "status": "affected",
              "version": "0.2.0",
              "versionType": "semver"
            }
          ]
        }
      ],
      "configurations": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "\u003cp\u003eapko runs on a 64-bit platform and installs a package that supplies \u003ccode\u003e/etc/passwd\u003c/code\u003e or \u003ccode\u003e/etc/group\u003c/code\u003e entries with an out-of-range UID or GID.\u003c/p\u003e"
            }
          ],
          "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."
        }
      ],
      "credits": [
        {
          "lang": "en",
          "type": "reporter",
          "value": "Fernando (https://github.com/fthomasella)"
        },
        {
          "lang": "en",
          "type": "remediation developer",
          "value": "Jorge Lucangeli Obes (https://github.com/jlucangelio)"
        },
        {
          "lang": "en",
          "type": "remediation reviewer",
          "value": "Steve Beattie (https://github.com/stevebeattie)"
        },
        {
          "lang": "en",
          "type": "coordinator",
          "value": "SunnyR (https://github.com/SunnyR)"
        },
        {
          "lang": "en",
          "type": "coordinator",
          "value": "Chainguard (https://chainguard.dev)"
        }
      ],
      "datePublic": "2026-09-23T22:40:00.000Z",
      "descriptions": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "\u003cp\u003eapko allows users to build and publish OCI container images built from apk packages. From version 0.2.0 to before version 1.4.5, \u003ccode\u003eUserEntry.Parse\u003c/code\u003e and \u003ccode\u003eGroupEntry.Parse\u003c/code\u003e in \u003ccode\u003epkg/passwd\u003c/code\u003e read the UID and GID fields of \u003ccode\u003e/etc/passwd\u003c/code\u003e and \u003ccode\u003e/etc/group\u003c/code\u003e entries with \u003ccode\u003estrconv.Atoi\u003c/code\u003e and convert them to \u003ccode\u003euint32\u003c/code\u003e without a range check. On 64-bit platforms an out-of-range value such as \u003ccode\u003e4294967296\u003c/code\u003e (2^32) is truncated to \u003ccode\u003e0\u003c/code\u003e, 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\u0027s run-as user. This issue has been fixed in version 1.4.5.\u003c/p\u003e"
            }
          ],
          "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\u0027s run-as user. This issue has been fixed in version 1.4.5."
        }
      ],
      "impacts": [
        {
          "capecId": "CAPEC-128",
          "descriptions": [
            {
              "lang": "en",
              "value": "CAPEC-128 Integer Attacks"
            }
          ]
        }
      ],
      "metrics": [
        {
          "cvssV4_0": {
            "Automatable": "NOT_DEFINED",
            "Recovery": "NOT_DEFINED",
            "Safety": "NOT_DEFINED",
            "attackComplexity": "LOW",
            "attackRequirements": "PRESENT",
            "attackVector": "NETWORK",
            "baseScore": 6.3,
            "baseSeverity": "MEDIUM",
            "exploitMaturity": "NOT_DEFINED",
            "privilegesRequired": "NONE",
            "providerUrgency": "NOT_DEFINED",
            "subAvailabilityImpact": "NONE",
            "subConfidentialityImpact": "NONE",
            "subIntegrityImpact": "LOW",
            "userInteraction": "NONE",
            "valueDensity": "NOT_DEFINED",
            "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",
            "version": "4.0",
            "vulnAvailabilityImpact": "NONE",
            "vulnConfidentialityImpact": "NONE",
            "vulnIntegrityImpact": "LOW",
            "vulnerabilityResponseEffort": "NOT_DEFINED"
          },
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-197",
              "description": "CWE-197 Numeric Truncation Error",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-10-05T20:17:46.477Z",
        "orgId": "82cea9a6-e9e3-46fe-bdb0-3673de380178",
        "shortName": "chainguard"
      },
      "references": [
        {
          "name": "GHSA-rj6x-hwpv-vhvf",
          "tags": [
            "vendor-advisory"
          ],
          "url": "https://github.com/chainguard-dev/apko/security/advisories/GHSA-rj6x-hwpv-vhvf"
        },
        {
          "name": "chainguard-dev/apko#2516",
          "tags": [
            "patch"
          ],
          "url": "https://github.com/chainguard-dev/apko/pull/2516"
        },
        {
          "name": "Fix commit 739e7ce",
          "tags": [
            "patch"
          ],
          "url": "https://github.com/chainguard-dev/apko/commit/739e7ce3f675ffb232e16849b51ff93657f1570c"
        },
        {
          "name": "apko v1.4.5",
          "tags": [
            "release-notes"
          ],
          "url": "https://github.com/chainguard-dev/apko/releases/tag/v1.4.5"
        }
      ],
      "solutions": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "\u003cp\u003eUpgrade 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.\u003c/p\u003e"
            }
          ],
          "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."
        }
      ],
      "source": {
        "advisory": "GHSA-rj6x-hwpv-vhvf",
        "discovery": "EXTERNAL"
      },
      "timeline": [
        {
          "lang": "en",
          "time": "2022-03-03T23:21:00.000Z",
          "value": "Truncating uint32 conversion introduced"
        },
        {
          "lang": "en",
          "time": "2026-09-21T22:49:00.000Z",
          "value": "Fix merged (chainguard-dev/apko#2516)"
        },
        {
          "lang": "en",
          "time": "2026-09-23T22:40:00.000Z",
          "value": "GHSA-rj6x-hwpv-vhvf published"
        },
        {
          "lang": "en",
          "time": "2026-09-28T00:51:00.000Z",
          "value": "apko v1.4.5 released"
        }
      ],
      "title": "apko /etc/passwd and /etc/group UID/GID truncation writes package-supplied entries as root",
      "x_generator": {
        "engine": "Vulnogram 1.0.5"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "82cea9a6-e9e3-46fe-bdb0-3673de380178",
    "assignerShortName": "chainguard",
    "cveId": "CVE-2026-105768",
    "datePublished": "2026-10-05T20:17:46.477Z",
    "dateReserved": "2026-10-05T19:21:04.930Z",
    "dateUpdated": "2026-10-06T13:59:32.353Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"cna\": {\"title\": \"apko /etc/passwd and /etc/group UID/GID truncation writes package-supplied entries as root\", \"source\": {\"advisory\": \"GHSA-rj6x-hwpv-vhvf\", \"discovery\": \"EXTERNAL\"}, \"credits\": [{\"lang\": \"en\", \"type\": \"reporter\", \"value\": \"Fernando (https://github.com/fthomasella)\"}, {\"lang\": \"en\", \"type\": \"remediation developer\", \"value\": \"Jorge Lucangeli Obes (https://github.com/jlucangelio)\"}, {\"lang\": \"en\", \"type\": \"remediation reviewer\", \"value\": \"Steve Beattie (https://github.com/stevebeattie)\"}, {\"lang\": \"en\", \"type\": \"coordinator\", \"value\": \"SunnyR (https://github.com/SunnyR)\"}, {\"lang\": \"en\", \"type\": \"coordinator\", \"value\": \"Chainguard (https://chainguard.dev)\"}], \"impacts\": [{\"capecId\": \"CAPEC-128\", \"descriptions\": [{\"lang\": \"en\", \"value\": \"CAPEC-128 Integer Attacks\"}]}], \"metrics\": [{\"format\": \"CVSS\", \"cvssV4_0\": {\"Safety\": \"NOT_DEFINED\", \"version\": \"4.0\", \"Recovery\": \"NOT_DEFINED\", \"baseScore\": 6.3, \"Automatable\": \"NOT_DEFINED\", \"attackVector\": \"NETWORK\", \"baseSeverity\": \"MEDIUM\", \"valueDensity\": \"NOT_DEFINED\", \"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\", \"exploitMaturity\": \"NOT_DEFINED\", \"providerUrgency\": \"NOT_DEFINED\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"LOW\", \"attackRequirements\": \"PRESENT\", \"privilegesRequired\": \"NONE\", \"subIntegrityImpact\": \"LOW\", \"vulnIntegrityImpact\": \"LOW\", \"subAvailabilityImpact\": \"NONE\", \"vulnAvailabilityImpact\": \"NONE\", \"subConfidentialityImpact\": \"NONE\", \"vulnConfidentialityImpact\": \"NONE\", \"vulnerabilityResponseEffort\": \"NOT_DEFINED\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"GENERAL\"}]}], \"affected\": [{\"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\"}]}], \"timeline\": [{\"lang\": \"en\", \"time\": \"2022-03-03T23:21:00.000Z\", \"value\": \"Truncating uint32 conversion introduced\"}, {\"lang\": \"en\", \"time\": \"2026-09-21T22:49:00.000Z\", \"value\": \"Fix merged (chainguard-dev/apko#2516)\"}, {\"lang\": \"en\", \"time\": \"2026-09-23T22:40:00.000Z\", \"value\": \"GHSA-rj6x-hwpv-vhvf published\"}, {\"lang\": \"en\", \"time\": \"2026-09-28T00:51:00.000Z\", \"value\": \"apko v1.4.5 released\"}], \"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\", \"value\": \"\u003cp\u003eUpgrade 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.\u003c/p\u003e\", \"base64\": false}]}], \"datePublic\": \"2026-09-23T22:40:00.000Z\", \"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\"]}], \"x_generator\": {\"engine\": \"Vulnogram 1.0.5\"}, \"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\u0027s run-as user. This issue has been fixed in version 1.4.5.\", \"supportingMedia\": [{\"type\": \"text/html\", \"value\": \"\u003cp\u003eapko allows users to build and publish OCI container images built from apk packages. From version 0.2.0 to before version 1.4.5, \u003ccode\u003eUserEntry.Parse\u003c/code\u003e and \u003ccode\u003eGroupEntry.Parse\u003c/code\u003e in \u003ccode\u003epkg/passwd\u003c/code\u003e read the UID and GID fields of \u003ccode\u003e/etc/passwd\u003c/code\u003e and \u003ccode\u003e/etc/group\u003c/code\u003e entries with \u003ccode\u003estrconv.Atoi\u003c/code\u003e and convert them to \u003ccode\u003euint32\u003c/code\u003e without a range check. On 64-bit platforms an out-of-range value such as \u003ccode\u003e4294967296\u003c/code\u003e (2^32) is truncated to \u003ccode\u003e0\u003c/code\u003e, 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\u0027s run-as user. This issue has been fixed in version 1.4.5.\u003c/p\u003e\", \"base64\": false}]}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-197\", \"description\": \"CWE-197 Numeric Truncation Error\"}]}], \"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\", \"value\": \"\u003cp\u003eapko runs on a 64-bit platform and installs a package that supplies \u003ccode\u003e/etc/passwd\u003c/code\u003e or \u003ccode\u003e/etc/group\u003c/code\u003e entries with an out-of-range UID or GID.\u003c/p\u003e\", \"base64\": false}]}], \"providerMetadata\": {\"orgId\": \"82cea9a6-e9e3-46fe-bdb0-3673de380178\", \"shortName\": \"chainguard\", \"dateUpdated\": \"2026-10-05T20:17:46.477Z\"}}, \"adp\": [{\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2026-105768\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2026-10-06T13:59:21.787962Z\"}}}], \"providerMetadata\": {\"shortName\": \"CISA-ADP\", \"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"dateUpdated\": \"2026-10-06T13:59:28.433Z\"}}]}",
      "cveMetadata": "{\"cveId\": \"CVE-2026-105768\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-10-05T20:17:46.477Z\", \"dateReserved\": \"2026-10-05T19:21:04.930Z\", \"assignerOrgId\": \"82cea9a6-e9e3-46fe-bdb0-3673de380178\", \"datePublished\": \"2026-10-05T20:17:46.477Z\", \"assignerShortName\": \"chainguard\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…