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

Add njs as a target/profile #434

Merged
merged 2 commits into from
Jul 16, 2024
Merged

Conversation

0xbigshaq
Copy link
Contributor

Hi Samuel/Carl,
I took a small side-quest few weeks ago(for fun) and used fuzzilli. It led to writing this thingy.
This is my attempt to give back :D thank you for creating this project.

This PR adds njs as a new target/profile to fuzz so everyone can enjoy hehe

Note: The logic behind the hot-patching 'technique' I implemented here is: instead of using a .patch files - we leverage the way they designed their build system to 'extend' the language(add fuzzilli() builtin, make our own shell for REPRL, etc.). I found that approach more reliable and work with more revisions.

Copy link
Collaborator

@saelo saelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool, thanks for sharing! And sorry for the slow review... just a nit/suggestion the rest looks good!

@@ -0,0 +1,59 @@
// Copyright 2020 Google LLC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please update to 2024 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, fixed :^)


To build njs for fuzzing:
* Step 1 - prepare env
* Run `fuzzbuild.sh`, this will:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So typically, fuzzbuild.sh just takes care of performing the build, not downloading the source code. You could rename this to maybe setup.sh or so, and then put steps 2 and 3 into a fuzzbuild.sh. That would be more consistent. No strong opinion though, this is also fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's actually a good point, changed it. Thanks

* `NjsProfile.swift`: fix typo
* Split the helper scripts into `setup.sh` and `fuzzbuild.sh`
* Update the README.md file accordingly
@0xbigshaq 0xbigshaq requested a review from saelo July 13, 2024 00:05
@saelo saelo merged commit 5432e70 into googleprojectzero:main Jul 16, 2024
2 of 3 checks passed
@saelo
Copy link
Collaborator

saelo commented Jul 16, 2024

Thanks again!

saelo pushed a commit that referenced this pull request Jul 19, 2024
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

Successfully merging this pull request may close these issues.

2 participants