exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

libbabl 0.1.62 Broken Double-Free Detection

libbabl 0.1.62 Broken Double-Free Detection
Posted Dec 15, 2020
Authored by Carter Yagemann

libbabl version 0.1.62 broken double-free detection proof of concept exploit.

tags | exploit, proof of concept
SHA-256 | c9625fdfa8e4f30279a1070a44fe6ea3eb8e3675976560ced8a254a2b39109ca

libbabl 0.1.62 Broken Double-Free Detection

Change Mirror Download
# Exploit Title: libbabl 0.1.62 - Broken Double Free Detection (PoC)
# Date: December 14, 2020
# Exploit Author: Carter Yagemann
# Vendor Homepage: https://www.gegl.org
# Software Link: https://www.gegl.org/babl/
# Version: libbabl 0.1.62 and newer
# Tested on: Debian Buster (Linux 4.19.0-9-amd64)
# Compile: gcc -Ibabl-0.1 -lbabl-0.1 babl-0.1.62_babl_free.c

/*
* Babl has an interesting way of managing buffers allocated and freed using babl_malloc()
* and babl_free(). This is the structure of its allocations (taken from babl-memory.c):
*
* typedef struct
* {
* char *signature;
* size_t size;
* int (*destructor)(void *ptr);
* } BablAllocInfo;
*
*
* signature is used to track whether a chunk was allocated by babl, and if so, whether
* it is currently allocated or freed. This is done by either pointing it to the global
* string "babl-memory" or "So long and thanks for all the fish." (babl-memory.c:44).
*
* Using this signature, babl can detect bad behavior's like double free (babl-memory.c:173):
*
* void
* babl_free (void *ptr,
* ...)
* {
* ...
* if (freed == BAI (ptr)->signature)
* fprintf (stderr, "\nbabl:double free detected\n");
*
*
* Or so the developers think. As it turns out, because babl internally uses libc's malloc()
* and free(), which has its own data that it stores within freed chunks, most systems will
* overwrite babl's signature variable upon freeing, breaking the double free detection.
* The simple PoC below demonstrates this:
*/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <babl/babl-memory.h>

int main(int argc, char **argv) {
void *buf = babl_malloc(42);
babl_free(buf);
// BUG: reports an "unknown" pointer warning when the following is clea=
rly a double free
babl_free(buf);

return 0;
}
Login or Register to add favorites

File Archive:

January 2023

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jan 1st
    0 Files
  • 2
    Jan 2nd
    13 Files
  • 3
    Jan 3rd
    5 Files
  • 4
    Jan 4th
    5 Files
  • 5
    Jan 5th
    9 Files
  • 6
    Jan 6th
    5 Files
  • 7
    Jan 7th
    0 Files
  • 8
    Jan 8th
    0 Files
  • 9
    Jan 9th
    18 Files
  • 10
    Jan 10th
    31 Files
  • 11
    Jan 11th
    30 Files
  • 12
    Jan 12th
    33 Files
  • 13
    Jan 13th
    25 Files
  • 14
    Jan 14th
    0 Files
  • 15
    Jan 15th
    0 Files
  • 16
    Jan 16th
    7 Files
  • 17
    Jan 17th
    25 Files
  • 18
    Jan 18th
    38 Files
  • 19
    Jan 19th
    6 Files
  • 20
    Jan 20th
    21 Files
  • 21
    Jan 21st
    0 Files
  • 22
    Jan 22nd
    0 Files
  • 23
    Jan 23rd
    24 Files
  • 24
    Jan 24th
    68 Files
  • 25
    Jan 25th
    22 Files
  • 26
    Jan 26th
    20 Files
  • 27
    Jan 27th
    17 Files
  • 28
    Jan 28th
    0 Files
  • 29
    Jan 29th
    0 Files
  • 30
    Jan 30th
    0 Files
  • 31
    Jan 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close