Heap-use-after-free in jsmn_parse in fluent-bit

fluent-bit Updated 02 Oct 2025

Summary

26/03/2022
HIGH
Yes i
High
Not published

OSV-2022-281: Heap-use-after-free in jsmn_parse. Affects fluent-bit across 2 version ranges.

< 7e6e42d1c12644b6d5007b0415553e24761e7e59 >= af7ef37d6f0c61a79a8bd66f603273245198e069, < 7568fddddca799fc921e9db29c3f57d67d0fd85c

Fixed in 7568fddddca799fc921e9db29c3f57d67d0fd85c. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Fluent Bit is an open-source and multi-platform log processor and forwarder. It allows you to collect logs from various sources, parse them, and send them to different destinations. It is widely used in applications and systems that require efficient log processing and forwarding. However, a vulnerability has been discovered in the jsmn_parse function of fluent-bit, which can lead to a heap-use-after-free condition.

Vulnerability Detail

The vulnerability in fluent-bit arises from a heap-use-after-free condition in the jsmn_parse function. This function is responsible for parsing JSON data, and the issue occurs when the function attempts to access a previously freed memory block. An attacker can exploit this vulnerability by crafting a specially crafted JSON payload, which, when processed by fluent-bit, triggers the use of the freed memory block. This can lead to various consequences, including crashes, information disclosure, or even remote code execution.

How To Fix

Minimum fixed version

7568fddddca799fc921e9db29c3f57d67d0fd85c

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating fluent-bit is not immediately feasible, a temporary workaround is to disable the processing of JSON data in fluent-bit. This can be achieved by modifying the configuration file to exclude JSON data sources or by using a different log processor until the update can be applied.

Conclusion

The heap-use-after-free vulnerability in jsmn_parse of fluent-bit can have serious consequences, including crashes and potential remote code execution. It is crucial to update fluent-bit to a version that includes the fix or apply the temporary workaround of disabling JSON data processing. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for fluent-bit →

Share this vulnerability

FAQ

Fluent Bit is an open-source log processor and forwarder used to collect, parse, and send logs from various sources to different destinations.

jsmn_parse is a function in fluent-bit responsible for parsing JSON data.

A heap-use-after-free vulnerability occurs when a program attempts to access memory that has already been freed. This can lead to crashes, information disclosure, or even remote code execution.

An attacker can exploit this vulnerability by crafting a specially crafted JSON payload that triggers the use of a freed memory block in fluent-bit.

Yes, this vulnerability has been fixed in fluent-bit versions 1.9.0 and later.

Related vulnerabilities

Recent vulnerabilities recorded for fluent-bit.

How To Fix

Minimum fixed version

7568fddddca799fc921e9db29c3f57d67d0fd85c

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback