Skip to content

CLi crash when calling with numerical fuzzingEngineFlags #531

@tstehr

Description

@tstehr

The CLI crashes ungracefully when trying to pass an argument that looks numerical to the fuzzingEngineFlags. I discovered this while trying to pass -max_total_time 60 to libFuzzer.

Note that this was a typo on my side, the correct argument is -max_total_time=60

To reproduce, run the following:

> yarn run jazzer fuzz.js corpus -- -max_total_time 60
==71008== Uncaught Exception: Jazzer.js: flag.startsWith is not a function
TypeError: flag.startsWith is not a function
    at /project/node_modules/@jazzer.js/core/core.ts:188:9
    at Array.some (<anonymous>)
    at prepareLibFuzzerArg0 (/project/node_modules/@jazzer.js/core/core.ts:186:47)
    at buildFuzzerOptions (/project/node_modules/@jazzer.js/core/core.ts:380:10)
    at startFuzzingNoInit (/project/node_modules/@jazzer.js/core/core.ts:172:24)
    at startFuzzing (/project/node_modules/@jazzer.js/core/core.ts:138:8)

The underlying issue seems to be yargs silently converting numerical-looking arguments into numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions