Use-after-free vulnerability in GNU Bison

bison Updated 02 Oct 2025

Summary

25/08/2020
N/A
Yes i
Medium
5.5

CVE-2020-24240: GNU Bison before 3.7.1 has a use-after-free in _obstack_free in lib/obstack.c (called from gram_lex) when a '\0' byte is encountered. Affects bison across 2 version ranges.

< 3.7.2-r0 < be95a4fe2951374676efc9454ffee8638faaf68d

Fixed in 3.7.2-r0. 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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

GNU Bison is a general-purpose parser generator that converts a grammar description into a C program for parsing. It is widely used in various software projects to generate parsers for different programming languages. The package is an essential component for developers working on language processing tasks.

Vulnerability Detail

The use-after-free vulnerability (CVE-2020-24240) in GNU Bison occurs in the _obstack_free function in lib/obstack.c. This vulnerability is triggered when a '\0' byte is encountered during parsing, leading to a use-after-free condition. Although the risk is limited to situations where Bison is used with untrusted input, there is a possibility of unsafe behavior with specific compiler/architecture combinations. The bug report emphasizes that the crash may occur in Bison itself, rather than in the code generated by Bison.

How To Fix

Minimum fixed version

3.7.2-r0

This is the first release that contains the fix.

sudo apk add --upgrade bison

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

Workaround

There is no specific workaround available for this vulnerability. However, users can minimize the risk by avoiding the use of Bison with untrusted input. It is crucial to update to the fixed version as soon as possible to eliminate the vulnerability entirely.

Conclusion

The use-after-free vulnerability in GNU Bison poses a risk when parsing untrusted input. It is crucial for users to update to the fixed version (3.7.2-r0 or later) to eliminate the vulnerability. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for bison →

Share this vulnerability

FAQ

GNU Bison is a parser generator used to convert grammar descriptions into C programs for parsing.

A use-after-free vulnerability occurs when a program continues to use a memory area after it has been freed, leading to potential crashes or arbitrary code execution.

The vulnerability in GNU Bison can result in crashes or potentially unsafe behavior when parsing untrusted input.

While there is no specific workaround, users can minimize the risk by avoiding the use of Bison with untrusted input and updating to the fixed version.

To fix the vulnerability, users should update the Bison package to version 3.7.2-r0 or later.

Related vulnerabilities

Recent vulnerabilities recorded for bison.

How To Fix

Minimum fixed version

3.7.2-r0

This is the first release that contains the fix.

sudo apk add --upgrade bison

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