GHSA-2hm9-h873-pgqh

Suggest an improvement
Source
https://github.com/advisories/GHSA-2hm9-h873-pgqh
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/09/GHSA-2hm9-h873-pgqh/GHSA-2hm9-h873-pgqh.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-2hm9-h873-pgqh
Aliases
Related
Published
2023-09-28T21:27:04Z
Modified
2024-08-21T14:57:38.952534Z
Severity
  • 5.9 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
OpenFGA Vulnerable to DoS from circular relationship definitions
Details

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.

Database specific
{
    "nvd_published_at": "2023-09-27T15:19:34Z",
    "cwe_ids": [
        "CWE-835"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2023-09-28T21:27:04Z"
}
References

Affected packages

Go / github.com/openfga/openfga

Package

Name
github.com/openfga/openfga
View open source insights on deps.dev
Purl
pkg:golang/github.com/openfga/openfga

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.3.2