CVE-2021-22538: Github.com/google/exposure notifications verification server Privilege Escalation Vulnerability

HIGH
Advisory Identifier: GHSA-5v95-v8c8-3rh6
CVSS 8.8
CWE-276
Published
Advisory Summary

CVE-2021-22538 is a HIGH (CVSS 8.8) privilege escalation vulnerability (CWE-276: Incorrect Default Permissions) affecting Github.com/google/exposure notifications verification server libraries in the Go ecosystem. The issue involves privilege escalation in rbac. Remediation is available by upgrading affected packages to version 0.23.1.

CVE-2021-22538 at a Glance

CVE Identifier CVE-2021-22538
GHSA Identifier GHSA-5v95-v8c8-3rh6
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-276: Incorrect Default Permissions
Affected Product Github.com/google/exposure notifications verification server
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

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:H).

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 High (A:H)

How to Fix CVE-2021-22538

To remediate this vulnerability, upgrade all affected Github.com/google/exposure notifications verification server 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/google/exposure-notifications-verification-server fixed: 0.23.1
Upgrade github.com/google/exposure-notifications-verification-server to 0.23.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/google/exposure-notifications-verification-server

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-22538, inspect your project dependencies for Github.com/google/exposure notifications verification server:

inspect dependencies for github.com/google/exposure-notifications-verification-server

Analyze the terminal output to locate any version of Github.com/google/exposure notifications verification server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.23.1), 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-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In Github.com/google/exposure notifications verification server, 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 Using a carefully crafted request or malicious proxy, a user with `UserWrite` permissions could create another user with higher privileges than their own due to insufficient checks on the allowed set of permissions. The event would be captured in the Event Log. ### Patches The issue has been fixed in 0.24.0 and 0.23.1. ### Workarounds For users who are unable to upgrade, we recommend auditing users who have `UserWrite` permissions and regularly reviewing the Event Log for malicious activity. ### Kudos Thank you to Michael Mazzolini (Ethical Hacker at WHO) for finding and disclosing this vulnerability.

CVE-2021-22538 Affected Github.com/google/exposure notifications verification server Versions

1 component(s)
Fixed Versions:
0.23.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/google/exposure-notifications-verification-server
Go
< 0.23.1
0.23.1

References

Frequently Asked Questions

What is CVE-2021-22538?
CVE-2021-22538 is a security vulnerability in Github.com/google/exposure notifications verification server involving Privilege escalation in rbac under CWE-276: Incorrect Default Permissions.
Which Github.com/google/exposure notifications verification server versions are affected?
Affected versions include releases prior to 0.23.1 across affected packages: github.com/google/exposure-notifications-verification-server.
What version fixes CVE-2021-22538?
Upgrading to 0.23.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/google/exposure-notifications-verification-server affected?
Yes, github.com/google/exposure-notifications-verification-server is affected in releases prior to 0.23.1. Upgrade your dependency to 0.23.1 or later.
What is the CVSS score of CVE-2021-22538?
CVE-2021-22538 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-22538?
CVE-2021-22538 is classified under CWE-276: Incorrect Default Permissions (During installation, installed file permissions are set to allow anyone to modify those files.).
How can I check Go dependencies for CVE-2021-22538?
Run the dependency tree command: 'inspect dependencies for github.com/google/exposure-notifications-verification-server'. 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-5v95-v8c8-3rh6",
  "modified" : "2021-05-20T22:26:21Z",
  "published" : "2021-05-21T14:32:55Z",
  "aliases" : [ "CVE-2021-22538" ],
  "summary" : "Privilege escalation in rbac",
  "details" : "### Impact\nUsing a carefully crafted request or malicious proxy, a user with `UserWrite` permissions could create another user with higher privileges than their own due to insufficient checks on the allowed set of permissions. The event would be captured in the Event Log.\n\n### Patches\nThe issue has been fixed in 0.24.0 and 0.23.1.\n\n### Workarounds\nFor users who are unable to upgrade, we recommend auditing users who have `UserWrite` permissions and regularly reviewing the Event Log for malicious activity.\n\n### Kudos\nThank you to Michael Mazzolini (Ethical Hacker at WHO) for finding and disclosing 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:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/google/exposure-notifications-verification-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.23.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 0.23.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/google/exposure-notifications-verification-server/security/advisories/GHSA-5v95-v8c8-3rh6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-22538"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/exposure-notifications-verification-server/commit/eb8cf40b12dbe79304f1133c06fb73419383cd95"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/exposure-notifications-verification-server/releases/tag/v0.23.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/exposure-notifications-verification-server/releases/tag/v0.24.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-276" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-20T22:26:21Z",
    "nvd_published_at" : "2021-03-31T21:15:00Z"
  }
}