Giter VIP home page Giter VIP logo

libnsfdb's Introduction

libnsfdb's People

Contributors

joachimmetz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libnsfdb's Issues

How do I run build.ps1?

Environment

  • Windows: 10.0.20348
  • PowerShell: 7.2.2
  • Python: 3.10.4

Unexpected behavior
Running PS D:\Code\libnsfdb> .\build.ps1 returns Missing Python: C:\Python37\python.exe

It's pretty obvious what the issue is, but I read through the entirety of https://github.com/libyal/libnsfdb/wiki/Building and found no mention of any specific version of Python.

A heap-buffer-overflow in libnsfdb_io_handle.c:3719:6

System info

Ubuntu X64, gcc (Ubuntu 5.5.0-12ubuntu1), nsfdbinfo (latest master 62bdef)

Configure

CC=/home/seviezhou/AlphaFuzz/tools/alpha-clang CXX=/home/seviezhou/AlphaFuzz/tools/alpha-clang++ ./configure --enable-shared=no

Command line

./nsfdbtools/nsfdbinfo @@

AddressSanitizer output

=================================================================
==5438==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62c00000782b at pc 0x00000052929b bp 0x7ffc0f39c730 sp 0x7ffc0f39c728
READ of size 1 at 0x62c00000782b thread T0
    #0 0x52929a in libnsfdb_io_handle_read_superblock /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_io_handle.c:3719:6
    #1 0x520902 in libnsfdb_file_open_read /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:1035:6
    #2 0x51fa33 in libnsfdb_file_open_file_io_handle /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:607:6
    #3 0x51f3ac in libnsfdb_file_open /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:325:6
    #4 0x517598 in main /home/seviezhou/libnsfdb/nsfdbtools/nsfdbinfo.c:229:6
    #5 0x7fdaecbc883f in __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:291
    #6 0x41a498 in _start (/home/seviezhou/libnsfdb/nsfdbtools/nsfdbinfo+0x41a498)

0x62c00000782b is located 0 bytes to the right of 30251-byte region [0x62c000000200,0x62c00000782b)
allocated by thread T0 here:
    #0 0x4de6a8 in malloc /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88
    #1 0x527784 in libnsfdb_io_handle_read_superblock /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_io_handle.c:3082:34
    #2 0x520902 in libnsfdb_file_open_read /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:1035:6
    #3 0x51fa33 in libnsfdb_file_open_file_io_handle /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:607:6

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_io_handle.c:3719:6 in libnsfdb_io_handle_read_superblock
Shadow bytes around the buggy address:
  0x0c587fff8eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c587fff8f00: 00 00 00 00 00[03]fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==5438==ABORTING

POC

heap-overflow-libnsfdb_io_handle_read_superblock-libnsfdb_io_handle-3719.zip

A heap-buffer-overflow in libnsfdb_rrv_bucket.c:381:3

System info

Ubuntu X64, gcc (Ubuntu 5.5.0-12ubuntu1), nsfdbinfo (latest master 62bdef)

Configure

CC=/home/seviezhou/AlphaFuzz/tools/alpha-clang CXX=/home/seviezhou/AlphaFuzz/tools/alpha-clang++ ./configure --enable-shared=no

Command line

./nsfdbtools/nsfdbinfo @@

AddressSanitizer output

=================================================================
==48413==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62c00000782b at pc 0x000000533634 bp 0x7ffe4ec3c4f0 sp 0x7ffe4ec3c4e8
READ of size 1 at 0x62c00000782b thread T0
    #0 0x533633 in libnsfdb_rrv_bucket_read /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_rrv_bucket.c:381:3
    #1 0x528da4 in libnsfdb_io_handle_read_superblock /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_io_handle.c:3835:7
    #2 0x520902 in libnsfdb_file_open_read /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:1035:6
    #3 0x51fa33 in libnsfdb_file_open_file_io_handle /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:607:6
    #4 0x51f3ac in libnsfdb_file_open /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:325:6
    #5 0x517598 in main /home/seviezhou/libnsfdb/nsfdbtools/nsfdbinfo.c:229:6
    #6 0x7ffb09faa83f in __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:291
    #7 0x41a498 in _start (/home/seviezhou/libnsfdb/nsfdbtools/nsfdbinfo+0x41a498)

0x62c00000782b is located 0 bytes to the right of 30251-byte region [0x62c000000200,0x62c00000782b)
allocated by thread T0 here:
    #0 0x4de6a8 in malloc /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88
    #1 0x527784 in libnsfdb_io_handle_read_superblock /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_io_handle.c:3082:34
    #2 0x520902 in libnsfdb_file_open_read /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:1035:6
    #3 0x51fa33 in libnsfdb_file_open_file_io_handle /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:607:6

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_rrv_bucket.c:381:3 in libnsfdb_rrv_bucket_read
Shadow bytes around the buggy address:
  0x0c587fff8eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c587fff8f00: 00 00 00 00 00[03]fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==48413==ABORTING

POC

heap-overflow-libnsfdb_rrv_bucket_read-libnsfdb_rrv_bucket-381.zip

A heap-buffer-overflow in libnsfdb_io_handle.c:3461:6

System info

Ubuntu X64, gcc (Ubuntu 5.5.0-12ubuntu1), nsfdbinfo (latest master 62bdef)

Configure

CC=/home/seviezhou/AlphaFuzz/tools/alpha-clang CXX=/home/seviezhou/AlphaFuzz/tools/alpha-clang++ ./configure --enable-shared=no

Command line

./nsfdbtools/nsfdbinfo @@

AddressSanitizer output

=================================================================
==68161==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62c000007831 at pc 0x000000529277 bp 0x7ffca508ae50 sp 0x7ffca508ae48
READ of size 1 at 0x62c000007831 thread T0
    #0 0x529276 in libnsfdb_io_handle_read_superblock /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_io_handle.c:3461:6
    #1 0x520902 in libnsfdb_file_open_read /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:1035:6
    #2 0x51fa33 in libnsfdb_file_open_file_io_handle /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:607:6
    #3 0x51f3ac in libnsfdb_file_open /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:325:6
    #4 0x517598 in main /home/seviezhou/libnsfdb/nsfdbtools/nsfdbinfo.c:229:6
    #5 0x7f71c8fd583f in __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:291
    #6 0x41a498 in _start (/home/seviezhou/libnsfdb/nsfdbtools/nsfdbinfo+0x41a498)

0x62c000007831 is located 6 bytes to the right of 30251-byte region [0x62c000000200,0x62c00000782b)
allocated by thread T0 here:
    #0 0x4de6a8 in malloc /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88
    #1 0x527784 in libnsfdb_io_handle_read_superblock /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_io_handle.c:3082:34
    #2 0x520902 in libnsfdb_file_open_read /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:1035:6
    #3 0x51fa33 in libnsfdb_file_open_file_io_handle /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_file.c:607:6

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/seviezhou/libnsfdb/libnsfdb/libnsfdb_io_handle.c:3461:6 in libnsfdb_io_handle_read_superblock
Shadow bytes around the buggy address:
  0x0c587fff8eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c587fff8ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c587fff8f00: 00 00 00 00 00 03[fa]fa fa fa fa fa fa fa fa fa
  0x0c587fff8f10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c587fff8f50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==68161==ABORTING

POC

heap-overflow-libnsfdb_io_handle_read_superblock-libnsfdb_io_handle-3461.zip

build error: unknown type name 'libfcache_cache_t'

While trying to build libnsfdb from the package libnsfdb-experimental-20170128.tar.gz, I encountered the following error during the make phase:

libnsfdb_bucket_list.c:37:6: error: unknown type name 'libfcache_cache_t'; did you mean 'libfdata_cache_t'?
   37 |      libfcache_cache_t *bucket_cache,
      |      ^~~~~~~~~~~~~~~~~
      |      libfdata_cache_t
make[1]: *** [Makefile:753: libnsfdb_bucket_list.lo] Error 1

I am guessing (!) that the file libnsfdb/libnsfdb_bucket_list.c is missing an include of libnsfdb_libfcache.h.

Sample NSF files?

Are there sample NSF files somewhere in this project that I'm missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.