Local Privilege Escalation in sccache
Description
On Linux the sccache client can execute arbitrary code with the privileges of a local sccache server, by preloading the code in a shared library passed to LD_PRELOAD.
If the server is run as root (which is the default when installing the snap package https://snapcraft.io/sccache ), this means a user running the sccache client can get root privileges.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A local privilege escalation vulnerability in sccache on Linux allows an unprivileged client to execute arbitrary code with the server's privileges via LD_PRELOAD, enabling root access when the server runs as root.
Root
Cause
The vulnerability lies in how the sccache client forwards environment variables to the server when submitting a compile request. The client copies the local environment, including the LD_PRELOAD variable, and sends it in the request [2][4]. The server then executes the compile command with those environment variables without sanitization. A FIXME comment in the source code already noted the risk of not stripping LD_PRELOAD [4].
Exploitation
An attacker can exploit this by setting LD_PRELOAD to the path of a malicious shared library. When the sccache client submits a compile request, the server loads the attacker-controlled library, executing arbitrary code with the server's privileges [1][2]. No additional authentication is needed beyond having a local user account on the same machine.
Impact
If the sccache server runs as root (the default when installed via the snap package [2][4]), a local unprivileged user can gain full root privileges by preloading a malicious library. This represents a complete compromise of the affected system, allowing the attacker to execute arbitrary commands or install persistent backdoors.
Mitigation
The vulnerability was fixed in sccache v0.4.0, released on 2023-03-17, where the environment variables are now stripped of LD_PRELOAD before sending to the server [3][4]. Users are strongly advised to update to this version or later. The fix was applied quietly without explicit mention in the release notes at the time [4].
- GitHub - mozilla/sccache: Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
- NVD - CVE-2023-1521
- Release v0.4.0 · mozilla/sccache
- GHSL-2023-046: Local Privilege Escalation in sccache - CVE-2023-1521
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
sccachecrates.io | < 0.4.0 | 0.4.0 |
Affected products
13- ghsa-coords11 versionspkg:cargo/sccachepkg:rpm/opensuse/sccache&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/sccache&distro=openSUSE%20Leap%2015.5pkg:rpm/suse/sccache&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/sccache&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/sccache&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/sccache&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP4pkg:rpm/suse/sccache&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP5pkg:rpm/suse/sccache&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP3pkg:rpm/suse/sccache&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/sccache&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3
< 0.4.0+ 10 more
- (no CPE)range: < 0.4.0
- (no CPE)range: < 0.4.2~3-150400.3.3.1
- (no CPE)range: < 0.4.2~3-150400.3.3.1
- (no CPE)range: < 0.4.1~18-150300.7.12.1
- (no CPE)range: < 0.4.1~18-150300.7.12.1
- (no CPE)range: < 0.4.1~18-150300.7.12.1
- (no CPE)range: < 0.4.2~3-150400.3.3.1
- (no CPE)range: < 0.4.2~3-150400.3.3.1
- (no CPE)range: < 0.4.1~18-150300.7.12.1
- (no CPE)range: < 0.4.1~18-150300.7.12.1
- (no CPE)range: < 0.4.1~18-150300.7.12.1
- Mozilla/sccachev5Range: 0
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-x7fr-pg8f-93f5ghsavendor-advisoryADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-1521ghsaADVISORY
- securitylab.github.com/advisories/GHSL-2023-046_ScCacheghsathird-party-advisoryADVISORY
- github.com/mozilla/sccache/releases/tag/v0.4.0ghsaWEB
- github.com/mozilla/sccache/security/advisories/GHSA-x7fr-pg8f-93f5ghsaWEB
News mentions
0No linked articles in our index yet.