CVE-2022-31677: Go.pinniped.dev Pinniped Supervisor Insufficient Session Expiration Vulnerability

MODERATE
Advisory Identifier: GHSA-rp4v-hhm6-rcv9
CVSS 4.9
CWE-613
Published
Advisory Summary

CVE-2022-31677 is a MODERATE (CVSS 4.9) pinniped supervisor insufficient session expiration vulnerability (CWE-613: Insufficient Session Expiration) affecting Go.pinniped.dev libraries in the Go ecosystem. The issue involves pinniped supervisor insufficient session expiration vulnerability. Remediation is available by upgrading affected packages to version 0.19.0.

CVE-2022-31677 at a Glance

CVE Identifier CVE-2022-31677
GHSA Identifier GHSA-rp4v-hhm6-rcv9
Severity MODERATE
CVSS v3.1 Base Score 4.9
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product Go.pinniped.dev
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.9

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

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

How to Fix CVE-2022-31677

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

go.pinniped.dev fixed: 0.19.0
Upgrade go.pinniped.dev to 0.19.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 go.pinniped.dev

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-31677, inspect your project dependencies for Go.pinniped.dev:

inspect dependencies for go.pinniped.dev

Analyze the terminal output to locate any version of Go.pinniped.dev in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.19.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-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In Go.pinniped.dev, 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 A user authenticating to Kubernetes clusters via the Pinniped Supervisor could potentially use their access token to continue their session beyond what proper use of their refresh token might allow. Access tokens issued by the Pinniped Supervisor have an intended expiration lifetime of approximately two minutes. The Pinniped CLI will automatically use the refresh token, which has a lifetime of approximately nine hours, to request a new access token after the access token's advertised expiration time elapses. Starting in Pinniped version 0.13.0, the Supervisor performs checks during each refresh request against the configured external identity provider to determine if the user should be allowed to continue their session. Thus, the short lifetime of the access token is intended to force users to be subjected to those checks often. For example, if a user's account in the external identity provider became locked, the next refresh would fail, and the user should lose access to the Kubernetes clusters fairly quickly. As another example, if a user's group membership changed in the external identity provider, the new group memberships would be reflected in their sessions with Kubernetes clusters within a fairly short window of time. Access tokens are cached in a local file by the Pinniped CLI (the kubectl plugin) and are sent back to the Supervisor (via HTTPS) to receive cluster-scoped credentials. Due to a bug in this token exchange, the expiration time of the submitted access token was not checked correctly, causing expired access tokens to continue to be accepted by this endpoint until the user's backend session data is deleted, approximately nine hours after their session started. This bug could allow a legitimate user to avoid the checks performed during refresh by maliciously skipping the refresh step. Note that the Pinniped CLI performs the refresh operation often, so the refresh checks are still performed often under normal usage of the CLI, despite this bug. Practical impact to versions before v0.13.0 is minimal, since those versions did not perform checks against the external identity provider during refreshes. In these versions, the user can perform refreshes to get a new access tokens without restriction for approximately nine hours, so the duration of their access is effectively unchanged by this bug. ### Patches The impacted token exchange feature was first introduced in v0.3.0. Versions v0.3.0 to v0.18.0 are effected by this bug. This vulnerability was found by the maintainers of Pinniped and fixed immediately. The fix was introduced in release v0.19.0. ### Workarounds There are no known workarounds. Upgrading the Supervisor is recommended, especially for users of v0.13.0 or newer. ### References The issue was fixed by PR [#1264](https://github.com/vmware-tanzu/pinniped/pull/1264). ### For more information If you have any questions or comments about this advisory, please reach out to the maintainers using one of the methods described in this repo's [README.md](https://github.com/vmware-tanzu/pinniped/blob/main/README.md#discussion).

CVE-2022-31677 Affected Go.pinniped.dev Versions

1 component(s)
Fixed Versions:
0.19.0
Product / Package Ecosystem Affected Versions Fixed Version
go.pinniped.dev
Go
≥ 0.3.0
< 0.19.0
0.19.0

References

Frequently Asked Questions

What is CVE-2022-31677?
CVE-2022-31677 is a security vulnerability in Go.pinniped.dev involving Pinniped Supervisor Insufficient Session Expiration vulnerability under CWE-613: Insufficient Session Expiration.
Which Go.pinniped.dev versions are affected?
Affected versions include releases prior to 0.19.0 across affected packages: go.pinniped.dev.
What version fixes CVE-2022-31677?
Upgrading to 0.19.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is go.pinniped.dev affected?
Yes, go.pinniped.dev is affected in releases prior to 0.19.0. Upgrade your dependency to 0.19.0 or later.
What is the CVSS score of CVE-2022-31677?
CVE-2022-31677 has a CVSS v3.1 base score of 4.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2022-31677?
CVE-2022-31677 is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check Go dependencies for CVE-2022-31677?
Run the dependency tree command: 'inspect dependencies for go.pinniped.dev'. 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-rp4v-hhm6-rcv9",
  "modified" : "2022-09-08T13:55:41Z",
  "published" : "2022-09-01T22:24:05Z",
  "aliases" : [ "CVE-2022-31677" ],
  "summary" : "Pinniped Supervisor Insufficient Session Expiration vulnerability",
  "details" : "### Impact\n\nA user authenticating to Kubernetes clusters via the Pinniped Supervisor could potentially use their access token to continue their session beyond what proper use of their refresh token might allow.\n\nAccess tokens issued by the Pinniped Supervisor have an intended expiration lifetime of approximately two minutes. The Pinniped CLI will automatically use the refresh token, which has a lifetime of approximately nine hours, to request a new access token after the access token's advertised expiration time elapses. Starting in Pinniped version 0.13.0, the Supervisor performs checks during each refresh request against the configured external identity provider to determine if the user should be allowed to continue their session. Thus, the short lifetime of the access token is intended to force users to be subjected to those checks often. For example, if a user's account in the external identity provider became locked, the next refresh would fail, and the user should lose access to the Kubernetes clusters fairly quickly. As another example, if a user's group membership changed in the external identity provider, the new group memberships would be reflected in their sessions with Kubernetes clusters within a fairly short window of time.\n\nAccess tokens are cached in a local file by the Pinniped CLI (the kubectl plugin) and are sent back to the Supervisor (via HTTPS) to receive cluster-scoped credentials. Due to a bug in this token exchange, the expiration time of the submitted access token was not checked correctly, causing expired access tokens to continue to be accepted by this endpoint until the user's backend session data is deleted, approximately nine hours after their session started. This bug could allow a legitimate user to avoid the checks performed during refresh by maliciously skipping the refresh step.\n\nNote that the Pinniped CLI performs the refresh operation often, so the refresh checks are still performed often under normal usage of the CLI, despite this bug.\n\nPractical impact to versions before v0.13.0 is minimal, since those versions did not perform checks against the external identity provider during refreshes. In these versions, the user can perform refreshes to get a new access tokens without restriction for approximately nine hours, so the duration of their access is effectively unchanged by this bug.\n\n### Patches\n\nThe impacted token exchange feature was first introduced in v0.3.0. Versions v0.3.0 to v0.18.0 are effected by this bug.\n\nThis vulnerability was found by the maintainers of Pinniped and fixed immediately. The fix was introduced in release v0.19.0.\n\n### Workarounds\n\nThere are no known workarounds. Upgrading the Supervisor is recommended, especially for users of v0.13.0 or newer.\n\n### References\n\nThe issue was fixed by PR [#1264](https://github.com/vmware-tanzu/pinniped/pull/1264).\n\n### For more information\n\nIf you have any questions or comments about this advisory, please reach out to the maintainers using one of the methods described in this repo's [README.md](https://github.com/vmware-tanzu/pinniped/blob/main/README.md#discussion).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "go.pinniped.dev"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.0"
      }, {
        "fixed" : "0.19.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vmware-tanzu/pinniped/security/advisories/GHSA-rp4v-hhm6-rcv9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31677"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vmware-tanzu/pinniped/pull/1264"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vmware-tanzu/pinniped"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vmware-tanzu/pinniped/releases/tag/v0.19.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-613" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-01T22:24:05Z",
    "nvd_published_at" : "2022-08-29T15:15:00Z"
  }
}