#json #fuzzer #arbitrary

bin+lib arbitrary-json

A Json generator based on serde_json and arbitrary

2 releases

0.1.1 Feb 23, 2022
0.1.0 Jan 13, 2022

#1727 in Development tools

Download history 71/week @ 2024-10-20 177/week @ 2024-10-27 99/week @ 2024-11-03 53/week @ 2024-11-10 130/week @ 2024-11-17 283/week @ 2024-11-24 156/week @ 2024-12-01 93/week @ 2024-12-08 100/week @ 2024-12-15 35/week @ 2024-12-22 48/week @ 2024-12-29 352/week @ 2025-01-05 78/week @ 2025-01-12 73/week @ 2025-01-19 47/week @ 2025-01-26 68/week @ 2025-02-02

521 downloads per month
Used in 2 crates

WTFPL license

7KB
97 lines

Arbitrary JSON

This crate provide a compatibility layer between serde_json and arbitrary. This allow you to generate random valid json when fuzzing your rust code. See the following example:

#![no_main]
use arbitrary_json::ArbitraryValue;
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: ArbitraryValue| {
    // call your very complex code here
    if data["truc"] == serde_json::json!(42) {
        panic!("Found the magic value");
    }
});

lib.rs:

Arbitrary JSON

This crate provide a compatibility layer between serde_json and arbitrary. This allow you to generate random valid json when fuzzing your rust code. See the following example:

#![no_main]
use arbitrary_json::ArbitraryValue;
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: ArbitraryValue| {
    // call your very complex code here
    if data["truc"] == serde_json::json!(42) {
        panic!("Found the magic value");
    }
});

Dependencies

~0.6–1MB
~22K SLoC