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

Multipart Input support #1617

Merged
merged 13 commits into from
Jan 4, 2024
Merged

Multipart Input support #1617

merged 13 commits into from
Jan 4, 2024

Conversation

addisoncrump
Copy link
Collaborator

This offers a basic implementation for multipart inputs with consistent sub-input types.

libafl/Cargo.toml Outdated Show resolved Hide resolved
@domenukk
Copy link
Member

domenukk commented Nov 3, 2023

What's the status here?

@addisoncrump
Copy link
Collaborator Author

Sorry, still needs some work. Lots going on right now 🙂 I'll try to address this in the upcoming days.

@addisoncrump addisoncrump mentioned this pull request Nov 7, 2023
9 tasks
@domenukk domenukk marked this pull request as draft November 19, 2023 19:41
@addisoncrump addisoncrump marked this pull request as ready for review January 2, 2024 17:37

// without this, artificial bug is not found
// maybe interesting to try to auto-derive this, researchers! :)
count_set(count);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

had to "cheat" here a little bit 😉

/// related, or represent distinct parts of the input.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct MultipartInput<I> {
parts: Vec<I>,
Copy link
Member

Choose a reason for hiding this comment

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

We could also have an input consisting of multipe different inputs at some point (but then we're basically doing grammar fuzzing?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately it is really hard (read: impossible) for me to do dynamic types like this. I tried, but it just didn't work because the type constraints on mutator eventually need a concrete type. Users will simply need to wrap MultipartInput<I1> and MultipartInput<I2> or similar.

Copy link
Member

Choose a reason for hiding this comment

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

Well we could do it the way we do Feedbacks, like, a MultiInput<I1, I2> and then a multiinput could have multiple multiinputs again (right?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem is the mutators -- it is not possible (to my knowledge) to have generic implementations for these with diverse input types. With this support as is, though, it shouldn't be too hard to implement what you're suggesting on a case-by-case basis.

@addisoncrump addisoncrump merged commit 99fd69a into main Jan 4, 2024
15 checks passed
@addisoncrump addisoncrump deleted the multi-stream branch January 4, 2024 00:51
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.

3 participants