Nest Labs Openweave Weave ASN1Writer PutValue Code Execution Vulnerability
A heap-based buffer overflow exists in the ASN1Writer::PutValue function of Openweave-core when converting a Weave certificate to X509 format. An attacker can craft a malicious Weave certificate to trigger the overflow, potentially leading to code execution.
An exploitable command execution vulnerability exists in the ASN1 certificate writing functionality of Openweave-core version 4.0.2. A specially crafted weave certificate can trigger a heap-based buffer overflow, resulting in code execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the length of the input ByteString TLV is not properly bounded, causing an integer overflow in the totalLen calculation within ASN1Writer::EncodeHead, which bypasses the buffer overflow check.
Impact
An attacker could potentially execute arbitrary code on the affected device, though the CVSS vector indicates high attack complexity and user interaction is required.
What the attacker needed
Victim opens a crafted certificate; user interaction required
How it was found
- Craft a Weave certificate containing a ByteString TLV with a length large enough to overflow the uint16_t totalLen calculation.
- Run the weave resign-command with the crafted certificate as input.
- The ReadCert function reads the certificate and calls ConvertWeaveCertToX509Cert.
- ConvertCert processes the TLV and reaches ConvertTBSCertificate, which calls ASN1Writer::PutValue with the oversized ByteString.
- PutValue calls EncodeHead, where the integer overflow bypasses the buffer overflow check.
- PutValue then writes the oversized ByteString into the heap buffer, causing a heap-based buffer overflow.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This report describes a memory corruption bug in a tool that converts certificates. When the tool processes a certificate with an overly large field, it miscalculates the space needed and writes more data than the buffer can hold, which can crash the program or let an attacker run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.