-
Notifications
You must be signed in to change notification settings - Fork 9
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
Applicability to dynamic languages? #1
Comments
Hey, yeah, I don't really see why not. Since you're a Mozilla person, I guess you were thinking of SpiderMonkey in particular? I have no experience with it, but if there is a standalone executable without too many dependencies (like a graphical environment) then it shouldn't be too hard to set it up with AFL instrumentation and get something running. |
Looks like SpiderMonkey has quite a bit of support for AFL already. I pushed the branch js that has some rules for JS and it seems to be doing something: However, JS does not have a terribly complicated syntax, I am guessing most bugs (if any) would be found in the interfaces/libraries rather than in the language itself. Well, I'll try running it for a bit :-) |
Yeah, almost certainly you need to teach it the name of builtin methods, or teach it how to discover them, for it to make real finds. |
FWIW, here's a list of identifiers that, at the time I was working on this, I thought were significant:
|
@vegard Did anything interesting come out of this? |
I ran it for a day or so just on my laptop, it came up with test cases like this:
I'm sure you can find something by 1) adding more library calls to the grammar file, 2) actually using the fork server (normal afl-fuzz is like 5x as fast, so that would help quite a bit), 3) running it continuously for a week or so on a beefier machine, then another cool thing to try would be 4) collect test cases like the ones above then pass them to normal afl-fuzz as the set of input test cases. I've pushed some more changes on the WIP js branch if you want to try it out. |
I didn't find any crashes, but I'm attaching a tarball with a JS/SpiderMonkey corpus. This contains test cases found using prog-fuzz and then further mutated by afl-fuzz. The corpus has been minimised by afl-cmin. You can still find new coverage every few minutes by running afl-fuzz in quick & dirty mode. Maybe this can be useful for kick-starting another fuzzing attempt. I don't have any contact with SpiderMonkey devs, but since the project has infrastructure set up to work with AFL already, there should be somebody who might want to try the corpus against their existing test cases to see if it adds anything to it. |
Thanks! (I probably should mention, while I work at Mozilla and have an active interest in fuzzing, my day job is sandboxing and other anti-exploitation work :-)). cc: @choller, who does work on Javascript fuzzing, in case there's anything interesting here. |
Last Thanksgiving, I had an idea to use libFuzzer as an input stream to a grammar to fuzz JS engines. Ultimately I didn't have a lot to show for it. There's a lot of success in fuzzing JS engines, but no success with coverage guided fuzzing as far as I'm aware.
I'm curious if you think the approach in prog-fuzz is applicable to dynamic languages, and if yes if you'd be interested in attempting to get one of the major engines going with prog-fuzz.
The text was updated successfully, but these errors were encountered: