-
-
Notifications
You must be signed in to change notification settings - Fork 144
Closed
Labels
CVEIssues related to public CVEs (security vuln reports)Issues related to public CVEs (security vuln reports)cbor
Milestone
Description
CBORParser.java _finishBytes() accepts an unchecked field string length value discovered during parsing, and is used to allocated a buffer. A malicious payload can be fabricated to exploit this and (at least) cause a java.lang.OutOfMemoryError exception.
@SuppressWarnings("resource")
protected byte[] _finishBytes(int len) throws IOException
{
// First, simple: non-chunked
if (len >= 0) {
if (len == 0) {
return NO_BYTES;
}
byte[] b = new byte[len]; <-- OutOfMemoryError here if len is large
I am not sure how serious this is in java. With an unmanaged runtime this would be critical security vulnerability.
For example, the following CBOR data (discovered by a fuzzer) leads to len = 2147483647 and triggers this exception on my laptop.
d9d9f7a35a7ffffffff7d9f7f759f7f7f7
This can probably be addressed by simple sanity checking of the len value (non-negative, some max limit).
Metadata
Metadata
Assignees
Labels
CVEIssues related to public CVEs (security vuln reports)Issues related to public CVEs (security vuln reports)cbor