libfuzzer | Rust bindings and utilities for LLVM ’ s libFuzzer | Compiler library

 by   rust-fuzz C++ Version: Current License: Non-SPDX

kandi X-RAY | libfuzzer Summary

kandi X-RAY | libfuzzer Summary

libfuzzer is a C++ library typically used in Utilities, Compiler applications. libfuzzer has no bugs, it has no vulnerabilities and it has low support. However libfuzzer has a Non-SPDX License. You can download it from GitHub.

Barebones wrapper around LLVM's libFuzzer runtime library. The CPP parts are extracted from compiler-rt git repository with git filter-branch. libFuzzer relies on LLVM sanitizer support. The Rust compiler has built-in support for LLVM sanitizer support, for now, it's limited to Linux. As a result, libfuzzer-sys only works on Linux.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              libfuzzer has a low active ecosystem.
              It has 98 star(s) with 28 fork(s). There are 12 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 11 open issues and 27 have been closed. On average issues are closed in 86 days. There are 4 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of libfuzzer is current.

            kandi-Quality Quality

              libfuzzer has 0 bugs and 0 code smells.

            kandi-Security Security

              libfuzzer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              libfuzzer code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              libfuzzer has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              libfuzzer releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              It has 63 lines of code, 7 functions and 1 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libfuzzer
            Get all kandi verified functions for this library.

            libfuzzer Key Features

            No Key Features are available at this moment for libfuzzer.

            libfuzzer Examples and Code Snippets

            No Code Snippets are available at this moment for libfuzzer.

            Community Discussions

            QUESTION

            How to fuzz test API as a whole and not with file inputs?
            Asked 2022-Mar-09 at 10:02

            I'm learning my way around fuzz testing C applications. As I understand it, most of the time when fuzzing, one has a C function that takes/reads files. The fuzzer is given a valid sample file, mutates it randomly or with coverage heuristics, and executes the function with this new input.

            But now I don't want to fuzz a function that takes file inputs but a few functions that together make up an API. For example:

            ...

            ANSWER

            Answered 2022-Feb-24 at 20:29

            To answer my own question:

            Yes, that's how API fuzzing can be done. For consuming the data bytewise the functions provided by libFuzzer #include (C++) could be used. Problem with this: The crash dump and fuzzer corpus won't be human readable.

            For a more readable fuzzer, implementing a structure aware custom data mutator for libFuzzer is beneficial.

            I used the premade data mutator libprotobuf-mutator (C++) to fuzz the example API. It generates valid input data based on a protocol buffer definition and not just (semi) random bytes. It does make the fuzzing a bit slower though. The bug in the given contrived example API was found after ~2min, compared to ~30secs with the basic byte consuming setup. But I do think that it would scale much better for larger (real) API's.

            Source https://stackoverflow.com/questions/71173169

            QUESTION

            How can I solve heap-buffer-overflow in my C-code?
            Asked 2021-Oct-06 at 12:11

            I am fairly new to C-coding and I have a task where we run libFuzzer on a basic C-program to exploit problems and fix them. This is my C-program (it takes a string input and changes "&" to "&", ">" to ">" and "<" to "<"):

            ...

            ANSWER

            Answered 2021-Oct-06 at 12:11

            After newstr = (char *)malloc(200);, newstr is not yet properly initialized so you must not call strncat( newstr, ... ).
            You can solve that e.g. by calling strcpy( newstr, "" ); after malloc() or by replacing malloc(200) with calloc(200,1) which fills the entire buffer with NUL.

            Besides, as @stevesummit has mentioned, despite its declaration there is no guarantee, that strlen(str) < 50. So instead of allocating a fix number of 200 characters, you should alloc strlen(str)*4 + 1 ... or strlen(str)*5 + 1 if what you're doing is HTML esacping and you realize that & should be replaced by &

            Source https://stackoverflow.com/questions/69465188

            QUESTION

            Understanding and different usage between libfuzzer and AFL
            Asked 2021-Aug-23 at 18:15

            I'm a noob to fuzz area and looked AFL implementation.

            AFL seems to replace stdin file descriptor to input file descriptor. Whenever the target program encounters standard input, the target program takes input from the input file, not the stdin.

            So, my question is popped from on this.

            Let's say we made a library and we'd like to unit test to find some implementation bug using fuzzer. In this case, we don't take any standard input, just takes only function parameters from developers who use our library. Therefore, AFL doesn't work in this case.

            Libfuzzer seems proper solution in this case since generated input can be fed into our specific interesting function.

            Is this right understand? or does AFL also can work as libfuzzer for the unit test?

            Thank you

            ...

            ANSWER

            Answered 2021-Aug-23 at 18:15

            Afl supports feeding inputs through files, not only stdin. To test a library that receives input through arguments, you can write a simple executable that will open an input file, read it's contents, call the needed library functions with argument values read from this file and close the file.

            Source https://stackoverflow.com/questions/68890003

            QUESTION

            What are PCs and PC tables in LibFuzzer
            Asked 2021-Jun-24 at 13:17

            I am trying to understand how code instrumentation works in LibFuzzer. From the documentation, i get that I can choose different type of instrumentation with the option -fsanitize-coverage.

            When starting the fuzzer, the INFO section indicates which instrumentation is used (here 8-bit counters)

            ...

            ANSWER

            Answered 2021-Jun-24 at 13:17

            In this context, PC means Program Counter as explained in this blog post

            In order to log coverage, the function trace_pc will log the program counter. With this information, the fuzzer knows, which paths are traversed on the given input values. Each fuzzing engine runs through this process differently.

            Source https://stackoverflow.com/questions/68065958

            QUESTION

            Singleton in libfuzzer
            Asked 2021-May-03 at 16:36

            Will singleton created in libfuzzer be "one instance per run" or "one instance per multiple runs"?

            Example:

            ...

            ANSWER

            Answered 2021-May-03 at 16:36

            Late answer - there will be single instance per multiple runs.

            Source https://stackoverflow.com/questions/66579052

            QUESTION

            How to call a renamed symbol in an external object file?
            Asked 2020-Nov-13 at 17:03

            I am trying to fuzz a particular piece of code using LLVM libFuzzer that only exposes its main() function externally. I have access to the source of the target code, but cannot change it.

            If I try to directly include the object file, it conflicts with the main definition provided by -fsanitize=fuzzer. I thought I might be able to solve this by renaming the main symbol in the object file:

            ...

            ANSWER

            Answered 2020-Nov-13 at 17:03

            You are not accounting for C++'s name mangling. The symbol for stub_main is likely a string containing main as well as some obfuscated info about arguments, type of function, and return type. In my platform it's __Z9stub_mainiPPc. The symbol for main would likely just be main or main_.

            You can try looking how main and stub_main definitions mangle in your platform with objdump -d *.o, and then you can replace these strings with objcopy --redefine-sym.

            Alternatively, as matoro said, you can declare the function as extern "C" so that no name mangling takes place.

            Source https://stackoverflow.com/questions/64824492

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install libfuzzer

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/rust-fuzz/libfuzzer.git

          • CLI

            gh repo clone rust-fuzz/libfuzzer

          • sshUrl

            git@github.com:rust-fuzz/libfuzzer.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Compiler Libraries

            rust

            by rust-lang

            emscripten

            by emscripten-core

            zig

            by ziglang

            numba

            by numba

            kotlin-native

            by JetBrains

            Try Top Libraries by rust-fuzz

            afl.rs

            by rust-fuzzRust

            cargo-fuzz

            by rust-fuzzRust

            arbitrary

            by rust-fuzzRust

            honggfuzz-rs

            by rust-fuzzRust

            targets

            by rust-fuzzRust