Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLi crash when calling with numerical fuzzingEngineFlags #531

Closed
tstehr opened this issue Jul 31, 2023 · 2 comments
Closed

CLi crash when calling with numerical fuzzingEngineFlags #531

tstehr opened this issue Jul 31, 2023 · 2 comments

Comments

@tstehr
Copy link

tstehr commented Jul 31, 2023

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.

@bertschneider
Copy link
Contributor

Thanks for the bug report and analysis! As we're in the process of streamlining parameter handling and already changed quite a bit of code in that area, I added a fix directly to #530 to prevent complicated merge conflicts.

In the future this situation should print a message like:

WARNING: unrecognized flag '-max_total_time'; use -help=1 to list all flags

ERROR: The required directory "10" does not exist

Admittedly not the nicest one but it should point to the problem good enough.

@bertschneider
Copy link
Contributor

Forgot about this issue, sorry. The mentioned PR was already merged some time back, so I will close this issue for now. Thx again for bringing it up 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants