GHSA-3jch-9qgp-4844 Generated code can read and write out of bounds in safe code
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:
- not expose flatbuffer generated code as part of their public APIs
- audit their code and look for any usage of
follow,push, or any method that uses them (e.g.self_follow). - 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.
| Package | Affected | Fixed in |
|---|---|---|
flatbuffers crates.io | All versions | 22.9.29 |
flatbuffers crates.io | All versions | 22.9.29 |
flatbuffers crates.io | From 0.0.0-0 | 22.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.