CVE-2025-53945: Chainguard.dev/apko Apko Is Vulnerable To Attack Vulnerability

HIGH
Advisory Identifier: GHSA-x6ph-r535-3vjw
CVSS 7.0
CWE-276
Published
Advisory Summary

CVE-2025-53945 is a HIGH (CVSS 7.0) apko is vulnerable to attack vulnerability (CWE-276: Incorrect Default Permissions) affecting Chainguard.dev/apko libraries in the Go ecosystem. The issue involves apko is vulnerable to attack through incorrect permissions in /etc/ld.so.cache and other files. Remediation is available by upgrading affected packages to version 0.29.5.

CVE-2025-53945 at a Glance

CVE Identifier CVE-2025-53945
GHSA Identifier GHSA-x6ph-r535-3vjw
Severity HIGH
CVSS v3.1 Base Score 7.0
CWE Classification CWE-276: Incorrect Default Permissions
Affected Product Chainguard.dev/apko
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:L).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2025-53945

To remediate this vulnerability, upgrade all affected Chainguard.dev/apko dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

chainguard.dev/apko fixed: 0.29.5
Upgrade chainguard.dev/apko to 0.29.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for chainguard.dev/apko

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-53945, inspect your project dependencies for Chainguard.dev/apko:

inspect dependencies for chainguard.dev/apko

Analyze the terminal output to locate any version of Chainguard.dev/apko in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.29.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In Chainguard.dev/apko, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

It was discovered that the ld.so.cache in images generated by apko had file system permissions mode `0666`: ``` bash-5.3# find / -type f -perm -o+w /etc/ld.so.cache ``` This issue was introduced in commit [04f37e2 ("generate /etc/ld.so.cache (#1629)")](https://github.com/chainguard-dev/apko/commit/04f37e2d50d5a502e155788561fb7d40de705bd9)([v0.27.0](https://github.com/chainguard-dev/apko/releases/tag/v0.27.0)). ### Impact This potentially allows a local unprivileged user to add additional additional directories including dynamic libraries to the dynamic loader path. A user could exploit this by placing a malicious library in a directory they control. ### Patches This issue was addressed in apko in [aedb077 ("fix: /etc/ld.so.cache file permissions (#1758)")](https://github.com/chainguard-dev/apko/commit/aedb0772d6bf6e74d8f17690946dbc791d0f6af3) ([v0.29.5](https://github.com/chainguard-dev/apko/releases/tag/v0.29.5)). ### Acknowledgements Many thanks to Cody Harris from [H2O.ai](http://h2o.ai/) for reporting this issue.

CVE-2025-53945 Affected Chainguard.dev/apko Versions

1 component(s)
Fixed Versions:
0.29.5
Product / Package Ecosystem Affected Versions Fixed Version
chainguard.dev/apko
Go
≥ 0.27.0
< 0.29.5
0.29.5

References

Frequently Asked Questions

What is CVE-2025-53945?
CVE-2025-53945 is a security vulnerability in Chainguard.dev/apko involving apko is vulnerable to attack through incorrect permissions in /etc/ld.so.cache and other files under CWE-276: Incorrect Default Permissions.
Which Chainguard.dev/apko versions are affected?
Affected versions include releases prior to 0.29.5 across affected packages: chainguard.dev/apko.
What version fixes CVE-2025-53945?
Upgrading to 0.29.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is chainguard.dev/apko affected?
Yes, chainguard.dev/apko is affected in releases prior to 0.29.5. Upgrade your dependency to 0.29.5 or later.
What is the CVSS score of CVE-2025-53945?
CVE-2025-53945 has a CVSS v3.1 base score of 7.0 (HIGH) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:L.
What CWE is associated with CVE-2025-53945?
CVE-2025-53945 is classified under CWE-276: Incorrect Default Permissions (During installation, installed file permissions are set to allow anyone to modify those files.).
How can I check Go dependencies for CVE-2025-53945?
Run the dependency tree command: 'inspect dependencies for chainguard.dev/apko'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-x6ph-r535-3vjw",
  "modified" : "2025-07-18T20:03:25Z",
  "published" : "2025-07-18T20:03:25Z",
  "aliases" : [ "CVE-2025-53945" ],
  "summary" : "apko is vulnerable to attack through incorrect permissions in /etc/ld.so.cache and other files",
  "details" : "It was discovered that the ld.so.cache in images generated by apko had file system permissions mode `0666`:\n```\nbash-5.3# find / -type f -perm -o+w\n/etc/ld.so.cache\n```\n\nThis issue was introduced in commit [04f37e2 (\"generate /etc/ld.so.cache (#1629)\")](https://github.com/chainguard-dev/apko/commit/04f37e2d50d5a502e155788561fb7d40de705bd9)([v0.27.0](https://github.com/chainguard-dev/apko/releases/tag/v0.27.0)).\n\n###  Impact\nThis potentially allows a local unprivileged user to add additional additional directories including dynamic libraries to the dynamic loader path. A user could exploit this by placing a malicious library in a directory they control.\n\n### Patches\nThis issue was addressed in apko in [aedb077 (\"fix: /etc/ld.so.cache file permissions (#1758)\")](https://github.com/chainguard-dev/apko/commit/aedb0772d6bf6e74d8f17690946dbc791d0f6af3) ([v0.29.5](https://github.com/chainguard-dev/apko/releases/tag/v0.29.5)).\n\n### Acknowledgements\n\nMany thanks to Cody Harris from [H2O.ai](http://h2o.ai/) for reporting this issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "chainguard.dev/apko"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.27.0"
      }, {
        "fixed" : "0.29.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/chainguard-dev/apko/security/advisories/GHSA-x6ph-r535-3vjw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-53945"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chainguard-dev/apko/commit/04f37e2d50d5a502e155788561fb7d40de705bd9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chainguard-dev/apko/commit/aedb0772d6bf6e74d8f17690946dbc791d0f6af3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/chainguard-dev/apko"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chainguard-dev/apko/releases/tag/v0.29.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-276" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-18T20:03:25Z",
    "nvd_published_at" : "2025-07-18T16:15:30Z"
  }
}