BF Specification of CVE-2017-17833 SLPD Double Free in OpenSLP in v1.0.2 and v1.1.0

Missing reposition of the 'result' pointer leads to a dangling pointer due to reallocation of the same object via 'sendbuf', which, when used to resize (second reallocation) the object leads to a Double Free. If exploited, this can lead to a denial of service or an arbitrary (remote) code execution.

vendor:product: openslp:openslp:1.0.2

Bug Report

Code with Bug

Code with Fix

NVD Entry

MADMemory Addressing (MAD) class – The pointer to an object is initialized, dereferenced, repositioned, or reassigned to an improper memory address.
MMNMemory Management (MMN) class – An object is allocated, resized, or deallocated improperly.
RepositionReposition operation – Change the pointer to another position inside its object.
Reallocate-ExtendReallocate-Extend operation – Reserve a new larger piece of memory for an object at a new address, reassign its pointer, and release the previous piece of memory.
Code BugCode Bug type – Defect in the implementation of the operation – proper operands over an improper operation. A first cause for the chain of weaknesses underlying a software security vulnerability. Must be fixed to resolve the vulnerability.
   Missing CodeMissing Code bug - The operation is entirely absent.
Address Error/FaultAddress Fault/Error type – The object address in use is wrong.
   Dangling PointerDangling Pointer fault/error – Still holds the address of its successfully deallocated object (e.g., a pointer to a freed heap object or a returned by a function address of a stack object).
Memory Corruption/Disclosure Final ErrorMemory Corruption/Disclosure final error type – An exploitable or undefined system behavior caused by memory addressing, allocation, use, and deallocation bugs.
   Double Free
Operation AttributeDefinition
MechanismMechanism operation attribute type – Shows how the operation is performed.
   SequentialSequential operation attribute – The operation is via iterating over the object elements.
   ExplicitExplicit operation attribute – The operation is via a function/method call.
Source CodeSource Code operation attribute type – Shows where the operation code resides within the software, firmware, or circuit logic code.
   Third-PartyThird-Party operation attribute – The operation code is in a third-party software.
Execution SpaceExecution Space operation attribute type – Shows where the operation is executed or the privilege level at which it runs.
   UserlandUserland operation attribute – The bugged code runs in an environment with privilege levels, but in unprivileged mode (e.g., ring 3 in x86 architecture).
Operand AttributeDefinition
Address StateAddress State operand attribute type - Shows where the address is in the memory layout.
   HeapHeap operand attribute – The object is a dynamically allocated data structure (e.g., via malloc() and new).
Size KindSize Kind operand attribute type – Shows the object's limit for traversal.
   UsedUsed operand attribute – A supplied size of an object.