CVE-2023-1521: Sccache Sccache Vulnerable To Privilege Escalation Vulnerability

HIGH
Advisory Identifier: GHSA-x7fr-pg8f-93f5
CVSS 8.4
CWE-426
Published
Advisory Summary

CVE-2023-1521 is a HIGH (CVSS 8.4) sccache vulnerable to privilege escalation vulnerability (CWE-426: Untrusted Search Path) affecting Sccache libraries in the crates.io ecosystem. The issue involves sccache vulnerable to privilege escalation if server is run as root. Remediation is available by upgrading affected packages to version 0.4.0.

CVE-2023-1521 at a Glance

CVE Identifier CVE-2023-1521
GHSA Identifier GHSA-x7fr-pg8f-93f5
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-426: Untrusted Search Path
Affected Product Sccache
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 8.4

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

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

How to Fix CVE-2023-1521

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

sccache fixed: 0.4.0
Upgrade sccache to 0.4.0
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 sccache

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-1521, inspect your project dependencies for Sccache:

inspect dependencies for sccache

Analyze the terminal output to locate any version of Sccache in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.0), 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-426: Untrusted Search Path, where the product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control. In Sccache, 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

### Impact 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. ### Patches Upgrade to 0.4.0 ### Workarounds Don't run sccache server as root. ### GitHub Security Lab number GHSL-2023-046

CVE-2023-1521 Affected Sccache Versions

1 component(s)
Fixed Versions:
0.4.0
Product / Package Ecosystem Affected Versions Fixed Version
sccache
crates.io
< 0.4.0
0.4.0

References

Frequently Asked Questions

What is CVE-2023-1521?
CVE-2023-1521 is a security vulnerability in Sccache involving sccache vulnerable to privilege escalation if server is run as root under CWE-426: Untrusted Search Path.
Which Sccache versions are affected?
Affected versions include releases prior to 0.4.0 across affected packages: sccache.
What version fixes CVE-2023-1521?
Upgrading to 0.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sccache affected?
Yes, sccache is affected in releases prior to 0.4.0. Upgrade your dependency to 0.4.0 or later.
What is the CVSS score of CVE-2023-1521?
CVE-2023-1521 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-1521?
CVE-2023-1521 is classified under CWE-426: Untrusted Search Path (The product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control.).
How can I check crates.io dependencies for CVE-2023-1521?
Run the dependency tree command: 'inspect dependencies for sccache'. 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-x7fr-pg8f-93f5",
  "modified" : "2024-11-26T18:57:08Z",
  "published" : "2023-05-30T20:06:02Z",
  "aliases" : [ "CVE-2023-1521" ],
  "summary" : "sccache vulnerable to privilege escalation if server is run as root",
  "details" : "### Impact\n\nOn 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`.\n\nIf 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.\n\n\n### Patches\nUpgrade to 0.4.0\n\n### Workarounds\nDon't run sccache server as root. \n\n###  GitHub Security Lab number\n\nGHSL-2023-046",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "sccache"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mozilla/sccache/security/advisories/GHSA-x7fr-pg8f-93f5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-1521"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mozilla/sccache"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mozilla/sccache/releases/tag/v0.4.0"
  }, {
    "type" : "ADVISORY",
    "url" : "https://securitylab.github.com/advisories/GHSL-2023-046_ScCache"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-426" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-05-30T20:06:02Z",
    "nvd_published_at" : "2024-11-26T12:15:18Z"
  }
}