Heap-buffer-overflow in parse_relocation_info in radare2
Summary
OSV-2020-1386: Heap-buffer-overflow in parse_relocation_info. Affects radare2 versions >= ee9025c9170c15dea5e68d4d5179d41e78868493, < ca8d8b39f3e34a4fd943270330b80f1148129de4. Fixed in ca8d8b39f3e34a4fd943270330b80f1148129de4. 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
radare2 is an open-source framework for reverse engineering and analyzing binary files. It provides a set of tools and libraries to assist in tasks such as disassembling, debugging, and analyzing executable files. The vulnerability in question affects the parse_relocation_info function within radare2, which is responsible for parsing relocation information. This vulnerability can lead to a heap-buffer-overflow, potentially resulting in a crash or arbitrary code execution.
Vulnerability Detail
The vulnerability arises due to a heap-buffer-overflow in the parse_relocation_info function. This can be triggered by an attacker providing specially crafted relocation information, leading to a read of 4 bytes beyond the bounds of the allocated buffer. An attacker exploiting this vulnerability could potentially execute arbitrary code or cause a denial of service. The vulnerability was discovered through an OSS-Fuzz report and has been assigned a medium severity level.
How To Fix
Minimum fixed version
ca8d8b39f3e34a4fd943270330b80f1148129de4
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 workaround, users can avoid the vulnerability by refraining from using the affected functionality or by implementing input validation to ensure that only valid relocation information is provided. Here is an example of how input validation can be implemented in C:
void parse_relocation_info(char* relocation_info) {
if (validate_relocation_info(relocation_info)) {
// Proceed with parsing
} else {
// Handle invalid input
}
}
bool validate_relocation_info(char* relocation_info) {
// Implement validation logic
}
Conclusion
In conclusion, the heap-buffer-overflow vulnerability in parse_relocation_info in radare2 can be mitigated by updating to a version that includes the fix. Users can also implement input validation as a temporary workaround. For further assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for radare2 →
FAQ
radare2 is an open-source framework for reverse engineering and analyzing binary files. It provides a range of tools and libraries for tasks such as disassembling, debugging, and analyzing executable files.
This vulnerability can lead to a heap-buffer-overflow, potentially resulting in a crash or arbitrary code execution. An attacker exploiting this vulnerability could gain control over the affected system or cause a denial of service.
This vulnerability was discovered through an OSS-Fuzz report, which identified a heap-buffer-overflow in the parse_relocation_info function.
This vulnerability has been assigned a medium severity level.
To fix this vulnerability, it is recommended to update radare2 to a version that includes the fix. The fix for this vulnerability was implemented in commit ca8d8b39f3e34a4fd943270330b80f1148129de4.
References
Related vulnerabilities
Recent vulnerabilities recorded for radare2.