GHSA-3jch-9qgp-4844: Flatbuffers Generated Code Can Read And Vulnerability

CRITICAL
CVSS 9.8
Published
Advisory Summary

GHSA-3jch-9qgp-4844 is a CRITICAL (CVSS 9.8) generated code can read and vulnerability (General Security Weakness) affecting Flatbuffers libraries in the crates.io ecosystem. The issue involves generated code can read and write out of bounds in safe code. Remediation is available by upgrading affected packages to version 22.9.29.

GHSA-3jch-9qgp-4844 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3jch-9qgp-4844
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification General Security Weakness
Affected Product Flatbuffers
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:U/C:H/I:H/A:H).

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

How to Fix GHSA-3jch-9qgp-4844

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

flatbuffers fixed: 22.9.29
Upgrade flatbuffers to 22.9.29
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 flatbuffers

How to Check if You Are Affected

To determine whether your application is affected by GHSA-3jch-9qgp-4844, inspect your project dependencies for Flatbuffers:

inspect dependencies for flatbuffers

Analyze the terminal output to locate any version of Flatbuffers in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 22.9.29), 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 General Security Weakness. In Flatbuffers, 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

Code generated by flatbuffers' compiler is `unsafe` but not marked as such. See https://github.com/google/flatbuffers/issues/6627 for details. All users that use generated code by `flatbuffers` compiler are recommended to: 1. not expose flatbuffer generated code as part of their public APIs 2. audit their code and look for any usage of `follow`, `push`, or any method that uses them (e.g. `self_follow`). 3. Carefuly go through the crates' documentation to understand which "safe" APIs are not intended to be used.

GHSA-3jch-9qgp-4844 Affected Flatbuffers Versions

1 component(s)
Fixed Versions:
22.9.29
Product / Package Ecosystem Affected Versions Fixed Version
flatbuffers
crates.io
< 22.9.29
22.9.29

References

Frequently Asked Questions

What is GHSA-3jch-9qgp-4844?
GHSA-3jch-9qgp-4844 is a security vulnerability in Flatbuffers involving Generated code can read and write out of bounds in safe code under General Security Weakness.
Which Flatbuffers versions are affected?
Affected versions include releases prior to 22.9.29 across affected packages: flatbuffers.
What version fixes GHSA-3jch-9qgp-4844?
Upgrading to 22.9.29 (or the latest patched release for your respective branch) resolves the vulnerability.
Is flatbuffers affected?
Yes, flatbuffers is affected in releases prior to 22.9.29. Upgrade your dependency to 22.9.29 or later.
What is the CVSS score of GHSA-3jch-9qgp-4844?
GHSA-3jch-9qgp-4844 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with GHSA-3jch-9qgp-4844?
GHSA-3jch-9qgp-4844 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-3jch-9qgp-4844?
Run the dependency tree command: 'inspect dependencies for flatbuffers'. 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-3jch-9qgp-4844",
  "modified" : "2022-06-16T23:54:35Z",
  "published" : "2022-06-16T23:54:35Z",
  "aliases" : [ ],
  "summary" : "Generated code can read and write out of bounds in safe code",
  "details" : "Code generated by flatbuffers' compiler is `unsafe` but not marked as such.\nSee https://github.com/google/flatbuffers/issues/6627 for details.\n\nAll users that use generated code by `flatbuffers` compiler are recommended to:\n1. not expose flatbuffer generated code as part of their public APIs\n2. audit their code and look for any usage of `follow`, `push`, or any method that uses them\n   (e.g. `self_follow`).\n3. Carefuly go through the crates' documentation to understand which \"safe\" APIs are not\n   intended to be used.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "flatbuffers"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "22.9.29"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/google/flatbuffers/issues/6627"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/flatbuffers/pull/7518"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/google/flatbuffers"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/flatbuffers/releases/tag/v22.9.29"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2021-0122.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-16T23:54:35Z",
    "nvd_published_at" : null
  }
}