An open API service providing security vulnerability metadata for many open source software ecosystems.

GSA_kwCzR0hTQS14NnBoLXI1MzUtM3Zqd84ABKSK

High EPSS: 0.00013% (0.01501 Percentile) EPSS:

apko is vulnerable to attack through incorrect permissions in /etc/ld.so.cache and other files

Affected Packages Affected Versions Fixed Versions
go:chainguard.dev/apko >= 0.27.0, < 0.29.5 0.29.5
15 Dependent packages
8 Dependent repositories

Affected Version Ranges

All affected versions

0.27.0, 0.27.1, 0.27.2, 0.27.3, 0.27.4, 0.27.5, 0.27.6, 0.27.7, 0.27.8, 0.27.9, 0.28.0, 0.29.0

All unaffected versions

0.1.1, 0.1.2, 0.2.0, 0.2.1, 0.2.2, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.9.0, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.12.0, 0.13.0, 0.13.1, 0.13.2, 0.13.3, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.14.4, 0.14.5, 0.14.6, 0.14.7, 0.14.8, 0.14.9, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 0.19.2, 0.19.3, 0.19.4, 0.19.5, 0.19.6, 0.19.7, 0.19.8, 0.19.9, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.22.0, 0.22.1, 0.22.2, 0.22.3, 0.22.4, 0.22.5, 0.22.6, 0.22.7, 0.23.0, 0.24.0, 0.25.0, 0.25.1, 0.25.2, 0.25.3, 0.25.4, 0.25.5, 0.25.6, 0.25.7, 0.26.0, 0.26.1

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)")(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)") (v0.29.5).

Acknowledgements

Many thanks to Cody Harris from H2O.ai for reporting this issue.

References: