GHSA-3jch-9qgp-4844 Generated code can read and write out of bounds in safe code

Not scored Published

Attackers can trigger memory corruption and potential code execution by providing malformed input to unsafe code generated by the flatbuffers compiler.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is GHSA-3jch-9qgp-4844?

GHSA-3jch-9qgp-4844 is a memory corruption vulnerability in flatbuffers, published on 31 Oct 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Code generated by flatbuffers' compiler is unsafe but not marked as such. See https://github.com/google/flatbuffers/issues/6627 for details.

For example, if generated code is used to decode malformed or untrusted input, undefined behavior (and thus security vulnerabilities) is possible even without the use of the unsafe keyword, violating the the meaning of "safe" code;

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. Carefully go through the crates' documentation to understand which "safe" APIs are not intended to be used.

Which versions are affected by GHSA-3jch-9qgp-4844?

3 open source packages ship an affected version, including flatbuffers.

PackageAffectedFixed in
flatbuffers crates.ioAll versions22.9.29
flatbuffers crates.ioAll versions22.9.29
flatbuffers crates.ioFrom 0.0.0-022.9.29

How do I fix GHSA-3jch-9qgp-4844?

Upgrade flatbuffers to 22.9.29 or later.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is GHSA-3jch-9qgp-4844 being exploited?

There is no known exploitation of GHSA-3jch-9qgp-4844 in the wild and no public exploit code.

Sources

Also known as RUSTSEC-2021-0122.

Is GHSA-3jch-9qgp-4844 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free