Skip to content
Memory corruption Disclosed report Intermediate

null pointer dereference and segfault in tile-count-merge

A null pointer dereference occurs in the tile-count-merge tool when processing a crafted input file, causing a segmentation fault. An attacker could crash the tool by providing a malicious file.

geeknik Follow

Originally disclosed on HackerOne

  • Fixed in 6 days
  • Disclosed after 10 days

This crash was triggered with 642f773 while fuzzing tile-count-merge with AFL on Debian 8 x64.

./tile-count-merge -o /dev/null test000

ASAN:SIGSEGV
=================================================================
==10201==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000048d0af bp 0x7ffd8644b6a0 sp 0x7ffd8644ae30 T0)
    #0 0x48d0ae in __interceptor_memcmp (/root/tile-count/tile-count-merge+0x48d0ae)
    #1 0x4dc6c9 in finder::operator<(finder const&) const /root/tile-count/merge.cpp:115:10
    #2 0x4dc6c9 in bool __gnu_cxx::__ops::_Iter_less_val::operator()<finder*, finder const>(finder*, finder const&) const /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/predefined_ops.h:54
    #3 0x4dc6c9 in finder* std::__lower_bound<finder*, finder, __gnu_cxx::__ops::_Iter_less_val>(finder*, finder*, finder const&, __gnu_cxx::__ops::_Iter_less_val) /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/stl_algobase.h:965
    #4 0x4ca6e0 in finder* std::lower_bound<finder*, finder>(finder*, finder*, finder const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/stl_algobase.h:999:14
    #5 0x4ca6e0 in do_merge(merge*, unsigned long, int, int, long long, int, bool, unsigned long) /root/tile-count/merge.cpp:213
    #6 0x4c38e4 in main /root/tile-count/mergetool.cpp:105:2
    #7 0x7fba250bcb44 in __libc_start_main /build/glibc-qK83Be/glibc-2.19/csu/libc-start.c:287
    #8 0x4c248c in _start (/root/tile-count/tile-count-merge+0x4c248c)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ??:0 __interceptor_memcmp
==10201==ABORTING

The original report as published on HackerOne, by geeknik. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 a null pointer dereference in the comparison function used during merging, where a pointer is not checked before being passed to memcmp.

What the attacker needed

Crafted input file; run tile-count-merge

How it was found

  1. Build tile-count-merge with commit 642f773.
  2. Run the tool with the crafted input file test000 and output to /dev/null.

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 crash in a program called tile-count-merge. When given a specially crafted file, the program tries to read from a memory address that is empty (null), which causes it to stop working. This is called a null pointer dereference.

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.

More by geeknik

View all

79 more disclosed reports, best first.

More from Mapbox

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.