VYPR
High severityNVD Advisory· Published Nov 26, 2024· Updated Nov 26, 2024

Local Privilege Escalation in sccache

CVE-2023-1521

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].

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.

PackageAffected versionsPatched versions
sccachecrates.io
< 0.4.00.4.0

Affected products

13

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

5

News mentions

0

No linked articles in our index yet.