CVE-2021-27851 (GCVE-0-2021-27851)

Vulnerability from cvelistv5 – Published: 2021-04-26 15:35 – Updated: 2024-09-17 02:11
VLAI
Title
Local privilege escalation in GNU Guix via guix-daemon and '--keep-failed'
Summary
A security vulnerability that can lead to local privilege escalation has been found in ’guix-daemon’. It affects multi-user setups in which ’guix-daemon’ runs locally. The attack consists in having an unprivileged user spawn a build process, for instance with `guix build`, that makes its build directory world-writable. The user then creates a hardlink to a root-owned file such as /etc/shadow in that build directory. If the user passed the --keep-failed option and the build eventually fails, the daemon changes ownership of the whole build tree, including the hardlink, to the user. At that point, the user has write access to the target file. Versions after and including v0.11.0-3298-g2608e40988, and versions prior to v1.2.0-75109-g94f0312546 are vulnerable.
CWE
  • CWE-264 - Permissions, Privileges, and Access Controls
Assigner
certcc CNA under the mitre root
CNA scorecard E 42/100 over 177 records in the last 180 days details
References
Impacted products
Vendor Product Version CPE status
GNU Guix guix-daemon Affected: v0.11.0-3298-g2608e40988 , < unspecified (custom)
Affected: unspecified , < v1.2.0-75109-g94f0312546 (custom)
guessed Create a notification for this product.
Date Public
2021-03-18 00:00
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-03T21:33:15.927Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_refsource_MISC",
              "x_transferred"
            ],
            "url": "https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/"
          },
          {
            "tags": [
              "x_refsource_MISC",
              "x_transferred"
            ],
            "url": "https://bugs.gnu.org/47229"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "product": "guix-daemon",
          "vendor": "GNU Guix",
          "versions": [
            {
              "lessThan": "unspecified",
              "status": "affected",
              "version": "v0.11.0-3298-g2608e40988",
              "versionType": "custom"
            },
            {
              "lessThan": "v1.2.0-75109-g94f0312546",
              "status": "affected",
              "version": "unspecified",
              "versionType": "custom"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Nathan Nye of WhiteBeam Security"
        }
      ],
      "datePublic": "2021-03-18T00:00:00.000Z",
      "descriptions": [
        {
          "lang": "en",
          "value": "A security vulnerability that can lead to local privilege escalation has been found in \u2019guix-daemon\u2019. It affects multi-user setups in which \u2019guix-daemon\u2019 runs locally. The attack consists in having an unprivileged user spawn a build process, for instance with `guix build`, that makes its build directory world-writable. The user then creates a hardlink to a root-owned file such as /etc/shadow in that build directory. If the user passed the --keep-failed option and the build eventually fails, the daemon changes ownership of the whole build tree, including the hardlink, to the user. At that point, the user has write access to the target file. Versions after and including v0.11.0-3298-g2608e40988, and versions prior to v1.2.0-75109-g94f0312546 are vulnerable."
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-264",
              "description": "CWE-264 Permissions, Privileges, and Access Controls",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2021-04-26T15:35:28.000Z",
        "orgId": "37e5125f-f79b-445b-8fad-9564f167944b",
        "shortName": "certcc"
      },
      "references": [
        {
          "tags": [
            "x_refsource_MISC"
          ],
          "url": "https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/"
        },
        {
          "tags": [
            "x_refsource_MISC"
          ],
          "url": "https://bugs.gnu.org/47229"
        }
      ],
      "source": {
        "discovery": "UNKNOWN"
      },
      "title": "Local privilege escalation in GNU Guix via guix-daemon and \u0027--keep-failed\u0027",
      "x_generator": {
        "engine": "Vulnogram 0.0.9"
      },
      "x_legacyV4Record": {
        "CVE_data_meta": {
          "ASSIGNER": "cert@cert.org",
          "DATE_PUBLIC": "2021-03-18T00:00:00.000Z",
          "ID": "CVE-2021-27851",
          "STATE": "PUBLIC",
          "TITLE": "Local privilege escalation in GNU Guix via guix-daemon and \u0027--keep-failed\u0027"
        },
        "affects": {
          "vendor": {
            "vendor_data": [
              {
                "product": {
                  "product_data": [
                    {
                      "product_name": "guix-daemon",
                      "version": {
                        "version_data": [
                          {
                            "version_affected": "\u003e=",
                            "version_value": "v0.11.0-3298-g2608e40988"
                          },
                          {
                            "version_affected": "\u003c",
                            "version_value": "v1.2.0-75109-g94f0312546"
                          }
                        ]
                      }
                    }
                  ]
                },
                "vendor_name": "GNU Guix"
              }
            ]
          }
        },
        "credit": [
          {
            "lang": "eng",
            "value": "Nathan Nye of WhiteBeam Security"
          }
        ],
        "data_format": "MITRE",
        "data_type": "CVE",
        "data_version": "4.0",
        "description": {
          "description_data": [
            {
              "lang": "eng",
              "value": "A security vulnerability that can lead to local privilege escalation has been found in \u2019guix-daemon\u2019. It affects multi-user setups in which \u2019guix-daemon\u2019 runs locally. The attack consists in having an unprivileged user spawn a build process, for instance with `guix build`, that makes its build directory world-writable. The user then creates a hardlink to a root-owned file such as /etc/shadow in that build directory. If the user passed the --keep-failed option and the build eventually fails, the daemon changes ownership of the whole build tree, including the hardlink, to the user. At that point, the user has write access to the target file. Versions after and including v0.11.0-3298-g2608e40988, and versions prior to v1.2.0-75109-g94f0312546 are vulnerable."
            }
          ]
        },
        "generator": {
          "engine": "Vulnogram 0.0.9"
        },
        "problemtype": {
          "problemtype_data": [
            {
              "description": [
                {
                  "lang": "eng",
                  "value": "CWE-264 Permissions, Privileges, and Access Controls"
                }
              ]
            }
          ]
        },
        "references": {
          "reference_data": [
            {
              "name": "https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/",
              "refsource": "MISC",
              "url": "https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/"
            },
            {
              "name": "https://bugs.gnu.org/47229",
              "refsource": "MISC",
              "url": "https://bugs.gnu.org/47229"
            }
          ]
        },
        "source": {
          "discovery": "UNKNOWN"
        }
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "37e5125f-f79b-445b-8fad-9564f167944b",
    "assignerShortName": "certcc",
    "cveId": "CVE-2021-27851",
    "datePublished": "2021-04-26T15:35:28.989Z",
    "dateReserved": "2021-03-01T00:00:00.000Z",
    "dateUpdated": "2024-09-17T02:11:05.201Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2021-27851",
      "date": "2026-12-01",
      "epss": "0.00334",
      "percentile": "0.28694"
    },
    "nvd": {
      "cve": {
        "configurations": [
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:a:gnu:guix:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "D489F131-C780-45C0-99CF-B59532F60807",
                    "versionEndExcluding": "1.2.0",
                    "versionStartIncluding": "0.11.0",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ]
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "A security vulnerability that can lead to local privilege escalation has been found in \u2019guix-daemon\u2019. It affects multi-user setups in which \u2019guix-daemon\u2019 runs locally. The attack consists in having an unprivileged user spawn a build process, for instance with `guix build`, that makes its build directory world-writable. The user then creates a hardlink to a root-owned file such as /etc/shadow in that build directory. If the user passed the --keep-failed option and the build eventually fails, the daemon changes ownership of the whole build tree, including the hardlink, to the user. At that point, the user has write access to the target file. Versions after and including v0.11.0-3298-g2608e40988, and versions prior to v1.2.0-75109-g94f0312546 are vulnerable."
          },
          {
            "lang": "es",
            "value": "Se ha encontrado una vulnerabilidad de seguridad en \"guix-daemon\" que puede conllevar a una escalada de privilegios local.\u0026#xa0;Afecta a las configuraciones multiusuario en las que \"guix-daemon\" se ejecuta localmente.\u0026#xa0;El ataque consiste en hacer que un usuario no privilegiado genere un proceso de compilaci\u00f3n, por ejemplo con \"guix build\", que hace que su directorio de compilaci\u00f3n sea world-writable.\u0026#xa0;Luego, el usuario crea un v\u00ednculo f\u00edsico a un archivo de propiedad root tal y como /etc/shadow en ese directorio de compilaci\u00f3n.\u0026#xa0;Si el usuario pas\u00f3 la opci\u00f3n --keep-failed y finalmente se produce un fallo en la compilaci\u00f3n, el demonio cambia la propiedad de todo el \u00e1rbol de compilaci\u00f3n, incluido el enlace f\u00edsico, al usuario.\u0026#xa0;En ese momento, el usuario tiene acceso de escritura al archivo de destino.\u0026#xa0;Las versiones posteriores a la v0.11.0-3298-g2608e40988 y las versiones anteriores a la v1.2.0-75109-g94f0312546 son vulnerables"
          }
        ],
        "id": "CVE-2021-27851",
        "lastModified": "2024-11-21T05:58:38.123",
        "metrics": {
          "cvssMetricV2": [
            {
              "acInsufInfo": false,
              "baseSeverity": "LOW",
              "cvssData": {
                "accessComplexity": "LOW",
                "accessVector": "LOCAL",
                "authentication": "NONE",
                "availabilityImpact": "NONE",
                "baseScore": 2.1,
                "confidentialityImpact": "NONE",
                "integrityImpact": "PARTIAL",
                "vectorString": "AV:L/AC:L/Au:N/C:N/I:P/A:N",
                "version": "2.0"
              },
              "exploitabilityScore": 3.9,
              "impactScore": 2.9,
              "obtainAllPrivilege": false,
              "obtainOtherPrivilege": false,
              "obtainUserPrivilege": false,
              "source": "nvd@nist.gov",
              "type": "Primary",
              "userInteractionRequired": false
            }
          ],
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "NONE",
                "baseScore": 5.5,
                "baseSeverity": "MEDIUM",
                "confidentialityImpact": "NONE",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 3.6,
              "source": "nvd@nist.gov",
              "type": "Primary"
            }
          ]
        },
        "published": "2021-04-26T16:15:07.433",
        "references": [
          {
            "source": "cret@cert.org",
            "tags": [
              "Issue Tracking",
              "Mailing List",
              "Patch",
              "Vendor Advisory"
            ],
            "url": "https://bugs.gnu.org/47229"
          },
          {
            "source": "cret@cert.org",
            "tags": [
              "Patch",
              "Vendor Advisory"
            ],
            "url": "https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "tags": [
              "Issue Tracking",
              "Mailing List",
              "Patch",
              "Vendor Advisory"
            ],
            "url": "https://bugs.gnu.org/47229"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "tags": [
              "Patch",
              "Vendor Advisory"
            ],
            "url": "https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/"
          }
        ],
        "sourceIdentifier": "cret@cert.org",
        "vulnStatus": "Modified",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-264"
              }
            ],
            "source": "cret@cert.org",
            "type": "Secondary"
          },
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-59"
              }
            ],
            "source": "nvd@nist.gov",
            "type": "Primary"
          }
        ]
      }
    },
    "redhat_vex": {
      "current_release_date": "2026-03-27T14:23:32+00:00",
      "cve": "CVE-2021-27851",
      "id": "CVE-2021-27851",
      "initial_release_date": "2021-03-18T00:00:00+00:00",
      "product_status:known_not_affected": "1",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "Local privilege escalation in GNU Guix via guix-daemon and \u0027--keep-failed\u0027",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2021/cve-2021-27851.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.