Heap-buffer-overflow in WriteSeqID in lcms
Summary
OSV-2022-625: Heap-buffer-overflow in WriteSeqID. Affects lcms versions >= 1394d740d96886b501e0ad04fe926a72eca3f01c, < 77758b7f815f4ced91e088ce855b31c90ad0a406. Fixed in 77758b7f815f4ced91e088ce855b31c90ad0a406. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
lcms is an open-source library that provides a set of functions for managing color profiles. It is commonly used in image processing applications to ensure accurate color reproduction. The library allows developers to perform color transformations, profile conversions, and other color-related operations. However, a vulnerability has been discovered in the WriteSeqID function of lcms, which can lead to a heap-buffer-overflow read of 8 bytes.
Vulnerability Detail
The vulnerability in WriteSeqID function of lcms arises from a heap-buffer-overflow read of 8 bytes. This can be triggered by a specially crafted input, potentially leading to a crash or arbitrary code execution. The issue was reported through the OSS-Fuzz project, and a detailed report can be found at OSS-Fuzz report. The vulnerability has a medium severity rating and affects versions of lcms from commit a9796f61c682f5320ff572c888062ee34315b836 to commit 6849af422fd296cb8ce160d376978ef5d79f9417 in the GitHub repository.
How To Fix
Minimum fixed version
77758b7f815f4ced91e088ce855b31c90ad0a406
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, developers can implement input validation and sanitization to prevent the exploitation of this vulnerability. By ensuring that input data is properly validated and does not exceed expected bounds, the risk of triggering the heap-buffer-overflow can be mitigated. Here is an example of input validation code in C:
// Validate input before passing to WriteSeqID
if (inputSize <= MAX_INPUT_SIZE) {
WriteSeqID(input);
}
Conclusion
In conclusion, a heap-buffer-overflow vulnerability has been discovered in the WriteSeqID function of lcms. This vulnerability can be mitigated by updating to a fixed version of the package or implementing input validation. For further assistance or support in addressing this vulnerability, please contact DevNack.com.
See every vulnerability recorded for lcms →
FAQ
lcms is an open-source library for managing color profiles in image processing applications.
A heap-buffer-overflow is a type of memory vulnerability where data is written or read outside the bounds of a heap-allocated buffer.
This vulnerability can be exploited by providing specially crafted input to the WriteSeqID function, potentially leading to a crash or arbitrary code execution.
The vulnerability has a medium severity rating.
To fix the vulnerability, update the lcms package to a version that includes the fix.
References
Related vulnerabilities
Recent vulnerabilities recorded for lcms.