CVE-2021-27098: Github.com/spiffe/spire Legacy Node API Allows Impersonation Vulnerability

HIGH
Advisory Identifier: GHSA-h746-rm5q-8mgq
CVSS 8.1
CWE-284 CWE-295
Published
Advisory Summary

CVE-2021-27098 is a HIGH (CVSS 8.1) legacy node api allows impersonation vulnerability (CWE-284: Improper Access Control) affecting Github.com/spiffe/spire libraries in the Go ecosystem. The issue involves legacy node api allows impersonation in github.com/spiffe/spire/pkg/server/endpoints/node. Remediation is available by upgrading affected packages to version 0.8.5, 0.9.4, 0.10.2, 0.11.3, 0.12.1.

CVE-2021-27098 at a Glance

CVE Identifier CVE-2021-27098
GHSA Identifier GHSA-h746-rm5q-8mgq
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-284: Improper Access Control
Affected Product Github.com/spiffe/spire
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.1

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

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

How to Fix CVE-2021-27098

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

github.com/spiffe/spire fixed: 0.8.5
Upgrade github.com/spiffe/spire to 0.8.5
github.com/spiffe/spire fixed: 0.9.4
Upgrade github.com/spiffe/spire to 0.9.4
github.com/spiffe/spire fixed: 0.10.2
Upgrade github.com/spiffe/spire to 0.10.2
github.com/spiffe/spire fixed: 0.11.3
Upgrade github.com/spiffe/spire to 0.11.3
github.com/spiffe/spire fixed: 0.12.1
Upgrade github.com/spiffe/spire to 0.12.1
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 github.com/spiffe/spire

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-27098, inspect your project dependencies for Github.com/spiffe/spire:

inspect dependencies for github.com/spiffe/spire

Analyze the terminal output to locate any version of Github.com/spiffe/spire in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.5), 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Github.com/spiffe/spire, 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

#### Summary In SPIRE 0.8.1 through 0.8.4 and before versions 0.9.4, 0.10.2, 0.11.3 and 0.12.1, specially crafted requests to the FetchX509SVID RPC of SPIRE Server’s Legacy Node API (github.com/spiffe/spire/pkg/server/endpoints/node) can result in the possible issuance of an X.509 certificate with a URI SAN for a SPIFFE ID that the agent is not authorized to distribute. Proper controls are in place to require that the caller presents a valid agent certificate that is already authorized to issue at least one SPIFFE ID, and the requested SPIFFE ID belongs to the same trust domain, prior to being able to trigger this vulnerability. This issue has been fixed in SPIRE versions 0.8.5, 0.9.4, 0.10.2, 0.11.3 and 0.12.1. #### What are the changes introduced by the patched versions? The changes introduced to address this issue are related to enforcing that the FetchX509SVID RPC of SPIRE Server’s Legacy Node API only issues X.509 certificates with SPIFFE IDs that the agent is authorized to distribute. The patched version also includes a back-ported change that improves the handling of file descriptors related to workload attestation in SPIRE Agent. There are no changes in the expected behavior of SPIRE. #### Should I upgrade SPIRE? All SPIRE users running affected versions are advised to upgrade to the corresponding patched version. #### Workarounds No workarounds have been identified for this vulnerability.

CVE-2021-27098 Affected Github.com/spiffe/spire Versions

5 component(s)
Fixed Versions:
0.8.50.9.40.10.20.11.30.12.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/spiffe/spire
Go
≥ 0.8.1
< 0.8.5
0.8.5
github.com/spiffe/spire
Go
≥ 0.9.0
< 0.9.4
0.9.4
github.com/spiffe/spire
Go
≥ 0.10.0
< 0.10.2
0.10.2
github.com/spiffe/spire
Go
≥ 0.11.0
< 0.11.3
0.11.3
github.com/spiffe/spire
Go
≥ 0.12.0
< 0.12.1
0.12.1

References

Frequently Asked Questions

What is CVE-2021-27098?
CVE-2021-27098 is a security vulnerability in Github.com/spiffe/spire involving Legacy Node API Allows Impersonation in github.com/spiffe/spire/pkg/server/endpoints/node under CWE-284: Improper Access Control.
Which Github.com/spiffe/spire versions are affected?
Affected versions include releases prior to 0.8.5, 0.9.4, 0.10.2, 0.11.3, 0.12.1 across affected packages: github.com/spiffe/spire.
What version fixes CVE-2021-27098?
Upgrading to 0.8.5, 0.9.4, 0.10.2, 0.11.3, 0.12.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/spiffe/spire affected?
Yes, github.com/spiffe/spire is affected in releases prior to 0.8.5, 0.9.4, 0.10.2, 0.11.3, 0.12.1. Upgrade your dependency to 0.8.5, 0.9.4, 0.10.2, 0.11.3, 0.12.1 or later.
What is the CVSS score of CVE-2021-27098?
CVE-2021-27098 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2021-27098?
CVE-2021-27098 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check Go dependencies for CVE-2021-27098?
Run the dependency tree command: 'inspect dependencies for github.com/spiffe/spire'. 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-h746-rm5q-8mgq",
  "modified" : "2023-10-02T12:04:37Z",
  "published" : "2021-05-21T14:31:11Z",
  "aliases" : [ "CVE-2021-27098" ],
  "summary" : "Legacy Node API Allows Impersonation in github.com/spiffe/spire/pkg/server/endpoints/node",
  "details" : "#### Summary\nIn SPIRE 0.8.1 through 0.8.4 and before versions 0.9.4, 0.10.2, 0.11.3 and 0.12.1, specially crafted requests to the FetchX509SVID RPC of SPIRE Server’s Legacy Node API (github.com/spiffe/spire/pkg/server/endpoints/node) can result in the possible issuance of an X.509 certificate with a URI SAN for a SPIFFE ID that the agent is not authorized to distribute. Proper controls are in place to require that the caller presents a valid agent certificate that is already authorized to issue at least one SPIFFE ID, and the requested SPIFFE ID belongs to the same trust domain, prior to being able to trigger this vulnerability. This issue has been fixed in SPIRE versions 0.8.5, 0.9.4, 0.10.2, 0.11.3 and 0.12.1.\n\n#### What are the changes introduced by the patched versions?\nThe changes introduced to address this issue are related to enforcing that the FetchX509SVID RPC of SPIRE Server’s Legacy Node API only issues X.509 certificates with SPIFFE IDs that the agent is authorized to distribute.\n\nThe patched version also includes a back-ported change that improves the handling of file descriptors related to workload attestation in SPIRE Agent.\n\nThere are no changes in the expected behavior of SPIRE.\n\n#### Should I upgrade SPIRE?\nAll SPIRE users running affected versions are advised to upgrade to the corresponding patched version.\n\n#### Workarounds\nNo workarounds have been identified for this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/spiffe/spire"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.8.1"
      }, {
        "fixed" : "0.8.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/spiffe/spire"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.0"
      }, {
        "fixed" : "0.9.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/spiffe/spire"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.10.0"
      }, {
        "fixed" : "0.10.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/spiffe/spire"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.11.0"
      }, {
        "fixed" : "0.11.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/spiffe/spire"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.12.0"
      }, {
        "fixed" : "0.12.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/spiffe/spire/security/advisories/GHSA-h746-rm5q-8mgq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-27098"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spiffe/spire/commit/3c5115b57afc20a0a2c2b1b9dd60dd1fd9082e13"
  }, {
    "type" : "WEB",
    "url" : "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-27098"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284", "CWE-295" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-21T14:28:38Z",
    "nvd_published_at" : null
  }
}