CVE-2023-43645: Github.com/openfga/openfga Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-2hm9-h873-pgqh
CVSS 5.9
CWE-835
Published
Advisory Summary

CVE-2023-43645 is a MODERATE (CVSS 5.9) denial of service vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Github.com/openfga/openfga libraries in the Go ecosystem. The issue involves openfga vulnerable to dos from circular relationship definitions. Remediation is available by upgrading affected packages to version 1.3.2.

CVE-2023-43645 at a Glance

CVE Identifier CVE-2023-43645
GHSA Identifier GHSA-2hm9-h873-pgqh
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product Github.com/openfga/openfga
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

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

How to Fix CVE-2023-43645

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

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-43645, inspect your project dependencies for Github.com/openfga/openfga:

inspect dependencies for github.com/openfga/openfga

Analyze the terminal output to locate any version of Github.com/openfga/openfga in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.2), 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-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Github.com/openfga/openfga, 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

## Overview OpenFGA is vulnerable to a DoS attack when certain Check calls are executed against authorization models that contain circular relationship definitions. When the call is made, it's possible for the server to exhaust resources and die. ## Am I Affected? Yes, if your store contains an authorization model that allows circular relationships. For example, with this model: ``` model schema 1.1 type user type group relations define memberA: [user] or memberB or memberC or memberD or memberE define memberB: [user] or memberA or memberC or memberD or memberE define memberC: [user] or memberA or memberB or memberD or memberE define memberD: [user] or memberA or memberB or memberC or memberE define memberE: [user] or memberA or memberB or memberC or memberD ``` This Check: `(user:anne, memberA, group:X)` can exhaust memory in the server. ## Fix Upgrade to v1.3.2 and update any offending models. **[BREAKING]** If your model contained cycles or a relation definition that has the relation itself in its evaluation path, then Checks and queries that require evaluation will no longer be evaluated on v1.3.2+ and will return errors instead. You will need to update your models to remove the cycles.

CVE-2023-43645 Affected Github.com/openfga/openfga Versions

1 component(s)
Fixed Versions:
1.3.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/openfga/openfga
Go
< 1.3.2
1.3.2

References

Frequently Asked Questions

What is CVE-2023-43645?
CVE-2023-43645 is a security vulnerability in Github.com/openfga/openfga involving OpenFGA Vulnerable to DoS from circular relationship definitions under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which Github.com/openfga/openfga versions are affected?
Affected versions include releases prior to 1.3.2 across affected packages: github.com/openfga/openfga.
What version fixes CVE-2023-43645?
Upgrading to 1.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/openfga/openfga affected?
Yes, github.com/openfga/openfga is affected in releases prior to 1.3.2. Upgrade your dependency to 1.3.2 or later.
What is the CVSS score of CVE-2023-43645?
CVE-2023-43645 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-43645?
CVE-2023-43645 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check Go dependencies for CVE-2023-43645?
Run the dependency tree command: 'inspect dependencies for github.com/openfga/openfga'. 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-2hm9-h873-pgqh",
  "modified" : "2023-09-28T21:27:04Z",
  "published" : "2023-09-28T21:27:04Z",
  "aliases" : [ "CVE-2023-43645" ],
  "summary" : "OpenFGA Vulnerable to DoS from circular relationship definitions",
  "details" : "## Overview\nOpenFGA is vulnerable to a DoS attack when certain Check calls are executed against authorization models that contain circular relationship definitions. When the call is made, it's possible for the server to exhaust resources and die.\n\n## Am I Affected?\nYes, if your store contains an authorization model that allows circular relationships. For example, with this model:\n\n```\nmodel\n  schema 1.1\n\ntype user\n\ntype group\n  relations\n    define memberA: [user] or memberB or memberC or memberD or memberE\n    define memberB: [user] or memberA or memberC or memberD or memberE\n    define memberC: [user] or memberA or memberB or memberD or memberE\n    define memberD: [user] or memberA or memberB or memberC or memberE\n    define memberE: [user] or memberA or memberB or memberC or memberD\n```\n\nThis Check: `(user:anne, memberA, group:X)` can exhaust memory in the server.\n\n## Fix\nUpgrade to v1.3.2 and update any offending models.\n\n  **[BREAKING]** If your model contained cycles or a relation definition that has the relation itself in its evaluation path, then Checks and queries that require evaluation will no longer be evaluated on v1.3.2+ and will return errors instead. You will need to update your models to remove the cycles.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/openfga/openfga"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/openfga/openfga/security/advisories/GHSA-2hm9-h873-pgqh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-43645"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openfga/openfga/commit/725296025fd81227c89525808652c6acd4a605f6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/openfga/openfga"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-28T21:27:04Z",
    "nvd_published_at" : "2023-09-27T15:19:34Z"
  }
}