Skip to content

OpenFGA Vulnerable to DoS from circular relationship definitions

Moderate severity GitHub Reviewed Published Sep 26, 2023 in openfga/openfga • Updated Nov 10, 2023

Package

gomod github.com/openfga/openfga (Go)

Affected versions

< 1.3.2

Patched versions

1.3.2

Description

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.

References

@jon-whit jon-whit published to openfga/openfga Sep 26, 2023
Published by the National Vulnerability Database Sep 27, 2023
Published to the GitHub Advisory Database Sep 28, 2023
Reviewed Sep 28, 2023
Last updated Nov 10, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

EPSS score

0.088%
(39th percentile)

Weaknesses

CVE ID

CVE-2023-43645

GHSA ID

GHSA-2hm9-h873-pgqh

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.