Cyber Risks · Trail of Bits Blog

Continuously fuzzing Python C extensions

Summary: Trail of Bits used Google's Atheris coverage-guided fuzzer, built on libFuzzer and Clang, to fuzz the cbor2 Python library's optional C extension and found multiple memory corruption bugs, including a NULL pointer dereference in a Py_DECREF call in decode_definite_string that the cbor2 developers fixed by adding a NULL check. The team packaged the setup in a Dockerfile, integrated cbor2 into Google's OSS-Fuzz service, and added a CIFuzz GitHub Actions workflow to fuzz on every commit and pull request. As of August 2023, OSS-Fuzz reports it has helped find and fix over 10,000 vulnerabilities and 36,000 bugs.

What's compelling: CBOR is used heavily within the blockchain community, which carries high-assurance security requirements, and a memory corruption bug in a C extension can lead to memory corruption or remote code execution. OSS-Fuzz fuzzes a project roughly once a day, so a project that stops at integration leaves every commit in between untested until CIFuzz or ClusterFuzzLite is added.

Read the original at Trail of Bits Blog ↗

Topics
Endpoint & Network Security
Related