# Generated code can read and write out of bounds in safe code

Source: https://junglewise.ai/threats/generated-code-can-read-and-write-out-of-bounds-in-safe-code-d3529e25  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-06-16  
License: CC BY 4.0 with a link back

Severity: low · CVSS 3.1 · Published 2022-06-16

Generated code can read and write out of bounds in safe code

Technologies: [flatbuffers (crates.io)](https://junglewise.ai/threats/technologies/flatbuffers). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 3.1, published 16 June 2022.

**Which products and versions are affected?** flatbuffers (crates.io) SEMVER:introduced=0,fixed=22.9.29.

**Is there a fix for This vulnerability?** Yes. flatbuffers (crates.io): upgrade to 22.9.29 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected?** Check whether you run flatbuffers (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- flatbuffers (crates.io): upgrade to 22.9.29 or later

  ```sh
  cargo update -p flatbuffers
  ```


## Affected products

- flatbuffers (crates.io) SEMVER:introduced=0,fixed=22.9.29

## Related threats

- [RUSTSEC-2021-0122 - Generated code can read and write out of bounds in safe code](https://junglewise.ai/threats/rustsec-2021-0122-generated-code-can-read-and-write-out-of-bounds-in-5454d397)
- [RUSTSEC-2020-0009 - `read_scalar` and `read_scalar_at` allow transmuting values without `unsafe` blocks](https://junglewise.ai/threats/cve-2020-35864-dangling-reference-in-flatbuffers)
- [RUSTSEC-2019-0028 - Unsound `impl Follow for bool`](https://junglewise.ai/threats/cve-2019-25004-unsound-casting-in-flatbuffers)
