Stack-use-after-scope vulnerability in grok

grok Updated 02 Oct 2025

Summary

09/04/2022
N/A
Yes i
Unrated
Not published

OSV-2022-321: Stack-use-after-scope in std::1::function::__func. Affects grok versions >= a27b85d5d31dc6da58aa8af859e63448a6384150, < 12ef5ef65d81862f0dcad9fafdbabb3c93a72934. Fixed in 12ef5ef65d81862f0dcad9fafdbabb3c93a72934. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Grok is an open-source image compression library that provides functionality for encoding and decoding images. It is widely used in various applications to optimize image storage and transmission. However, a stack-use-after-scope vulnerability has been discovered in the library, which can lead to potential security issues.

Vulnerability Detail

The stack-use-after-scope vulnerability in grok originates from a specific function called grk::WaveletReverse::decompress_partial_tile. This function is used for decompressing image tiles. The vulnerability occurs when the function attempts to write to a stack variable that has already gone out of scope. This can result in memory corruption and potentially lead to arbitrary code execution. The vulnerability has been reported through the OSS-Fuzz project.

How To Fix

Minimum fixed version

12ef5ef65d81862f0dcad9fafdbabb3c93a72934

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

As a temporary workaround, users can avoid using the grk::WaveletReverse::decompress_partial_tile function until the library is updated. By avoiding the vulnerable function, the risk of exploitation can be mitigated. However, this workaround may impact the functionality of applications that rely on the decompression of image tiles.

Conclusion

In conclusion, the grok library is affected by a stack-use-after-scope vulnerability in the grk::WaveletReverse::decompress_partial_tile function. Users should update to the latest version of the library that includes the fix to ensure the security of their applications. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for grok →

Share this vulnerability

FAQ

Grok is an open-source image compression library used for encoding and decoding images.

The vulnerability can lead to memory corruption and potentially allow arbitrary code execution.

The vulnerability was reported through the OSS-Fuzz project, which focuses on fuzz testing open-source software.

Yes, the vulnerability has been fixed in the grok library. Users should update to the latest version that includes the fix.

A temporary workaround is to avoid using the vulnerable function until the library is updated.

Related vulnerabilities

Recent vulnerabilities recorded for grok.

How To Fix

Minimum fixed version

12ef5ef65d81862f0dcad9fafdbabb3c93a72934

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