CVE-2021-39206: Github.com/pomerium/pomerium Incorrect Authorization With Specially Crafted Vulnerability

HIGH
Advisory Identifier: GHSA-cfc2-wjcm-c8fm
CVSS 8.6
CWE-863
Published
Advisory Summary

CVE-2021-39206 is a HIGH (CVSS 8.6) incorrect authorization with specially crafted vulnerability (CWE-863: Incorrect Authorization) affecting Github.com/pomerium/pomerium libraries in the Go ecosystem. The issue involves incorrect authorization with specially crafted requests. Remediation is available by upgrading affected packages to version 0.14.8, 0.15.1.

CVE-2021-39206 at a Glance

CVE Identifier CVE-2021-39206
GHSA Identifier GHSA-cfc2-wjcm-c8fm
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-863: Incorrect Authorization
Affected Product Github.com/pomerium/pomerium
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.6

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

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

How to Fix CVE-2021-39206

To remediate this vulnerability, upgrade all affected Github.com/pomerium/pomerium 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/pomerium/pomerium fixed: 0.14.8
Upgrade github.com/pomerium/pomerium to 0.14.8
github.com/pomerium/pomerium fixed: 0.15.1
Upgrade github.com/pomerium/pomerium to 0.15.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/pomerium/pomerium

How to Check if You Are Affected

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

inspect dependencies for github.com/pomerium/pomerium

Analyze the terminal output to locate any version of Github.com/pomerium/pomerium in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.14.8), 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Github.com/pomerium/pomerium, 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

Envoy, which Pomerium is based on, contains two authorization related vulnerabilities: - [CVE-2021-32777](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32779): incorrectly transform a URL containing a `#fragment` element, causing a mismatch in path-prefix based authorization decisions. - [CVE-2021-32779](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32777): incorrectly handle duplicate headers, dropping all but the last. This may lead to incorrect routing or authorization policy decisions. ### Impact With specially crafted requests, incorrect authorization or routing decisions may be made by Pomerium. ### Patches Pomerium v0.14.8 and v0.15.1 contain an upgraded envoy binary with these vulnerabilities patched. ### Workarounds - This issue can only be triggered when using path prefix based policy. Removing any such policies should provide mitigation. ### References [envoy GSA CVE-2021-32777](https://github.com/envoyproxy/envoy/security/advisories/GHSA-r222-74fw-jqr9) [envoy GSA CVE-2021-32779](https://github.com/envoyproxy/envoy/security/advisories/GHSA-6g4j-5vrw-2m8h) [envoy announcement](https://groups.google.com/g/envoy-announce/c/5xBpsEZZDfE/m/wD05NZBbAgAJ) ### For more information If you have any questions or comments about this advisory: * Open an issue in [pomerium/pomerium](https://github.com/pomerium/pomerium/issues) * Email us at [security@pomerium.com](mailto:security@pomerium.com)

CVE-2021-39206 Affected Github.com/pomerium/pomerium Versions

2 component(s)
Fixed Versions:
0.14.80.15.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/pomerium/pomerium
Go
≥ 0.11.0
< 0.14.8
0.14.8
github.com/pomerium/pomerium
Go
≥ 0.15.0
< 0.15.1
All 1 versions
0.15.0
0.15.1

References

Frequently Asked Questions

What is CVE-2021-39206?
CVE-2021-39206 is a security vulnerability in Github.com/pomerium/pomerium involving Incorrect Authorization with specially crafted requests under CWE-863: Incorrect Authorization.
Which Github.com/pomerium/pomerium versions are affected?
Affected versions include releases prior to 0.14.8, 0.15.1 across affected packages: github.com/pomerium/pomerium.
What version fixes CVE-2021-39206?
Upgrading to 0.14.8, 0.15.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/pomerium/pomerium affected?
Yes, github.com/pomerium/pomerium is affected in releases prior to 0.14.8, 0.15.1. Upgrade your dependency to 0.14.8, 0.15.1 or later.
What is the CVSS score of CVE-2021-39206?
CVE-2021-39206 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2021-39206?
CVE-2021-39206 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2021-39206?
Run the dependency tree command: 'inspect dependencies for github.com/pomerium/pomerium'. 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-cfc2-wjcm-c8fm",
  "modified" : "2021-09-10T16:40:43Z",
  "published" : "2021-09-10T17:54:25Z",
  "aliases" : [ "CVE-2021-39206" ],
  "summary" : "Incorrect Authorization with specially crafted requests",
  "details" : "Envoy, which Pomerium is based on, contains two authorization related vulnerabilities:\n\n- [CVE-2021-32777](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32779): incorrectly transform a URL containing a `#fragment` element, causing a mismatch in path-prefix based authorization decisions.\n- [CVE-2021-32779](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32777): incorrectly handle duplicate headers, dropping all but the last.  This may lead to incorrect routing or authorization policy decisions.\n\n### Impact\nWith specially crafted requests, incorrect authorization or routing decisions may be made by Pomerium.\n\n### Patches\n\nPomerium v0.14.8 and v0.15.1 contain an upgraded envoy binary with these vulnerabilities patched.\n\n### Workarounds\n\n- This issue can only be triggered when using path prefix based policy.  Removing any such policies should provide mitigation.\n\n\n### References\n[envoy GSA CVE-2021-32777](https://github.com/envoyproxy/envoy/security/advisories/GHSA-r222-74fw-jqr9)\n[envoy GSA CVE-2021-32779](https://github.com/envoyproxy/envoy/security/advisories/GHSA-6g4j-5vrw-2m8h)\n[envoy announcement](https://groups.google.com/g/envoy-announce/c/5xBpsEZZDfE/m/wD05NZBbAgAJ)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [pomerium/pomerium](https://github.com/pomerium/pomerium/issues)\n* Email us at [security@pomerium.com](mailto:security@pomerium.com)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pomerium/pomerium"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.11.0"
      }, {
        "fixed" : "0.14.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pomerium/pomerium"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.15.0"
      }, {
        "fixed" : "0.15.1"
      } ]
    } ],
    "versions" : [ "0.15.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/envoyproxy/envoy/security/advisories/GHSA-6g4j-5vrw-2m8h"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/envoyproxy/envoy/security/advisories/GHSA-r222-74fw-jqr9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pomerium/pomerium/security/advisories/GHSA-cfc2-wjcm-c8fm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-39206"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pomerium/pomerium"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/envoy-announce/c/5xBpsEZZDfE/m/wD05NZBbAgAJ"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-10T16:40:43Z",
    "nvd_published_at" : "2021-09-09T23:15:00Z"
  }
}