-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Add a fuzzer for Py_CompileStringExFlags
#111721
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
Conversation
Note that this new fuzz target already uncovers assertion failures in the CPython parser after running for a few minutes under honggfuzz. I probably should open an issue for that? |
Yes, please :) |
In particular, I'm seeing two assertion failures:
I will collect the relevant inputs and stack traces and open an issue for each one. |
Were those issues filed? |
@alex no, I haven't filed the issues yet. Let me give that another look this weekend! |
Please leave a comment here when you do!
…On Fri, Nov 17, 2023 at 3:33 PM Brad Larsen ***@***.***> wrote:
@alex no, I haven't filed the issues yet. Let me give that another look this weekend!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
--
All that is necessary for evil to succeed is for good people to do nothing.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small style suggestions, otherwise LGTM.
Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
Thank you @alex! |
FYI, you may be able to apply for a Patch Reward from Google for the fuzzers you've contributed: https://bughunters.google.com/open-source-security/patch-rewards |
This pull request adds a new fuzz target for the
Py_CompileStringExFlags
function in the "Very High Level Layer" C API. This function is essentially a C entry point to the Pythoncompile
builtin.This pull request also includes a handful of short, mostly nonsensical Python files written to demonstrate a number of syntactic forms that appear in Python.
Also included is a dictionary of most Python syntactic elements, often included with trailing spaces, to aid the fuzzers in producing inputs that have a chance of being syntactically valid.
Future work could include writing a structure-aware input mutator, which would take syntactically valid Python programs as input, and produce syntactically-valid mutated Python programs as outputs. This would likely get much deeper coverage from the fuzzers.
CC @alex @gpshead