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 fuzzer for Convert.To/FromBase64 APIs #108247

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

buyaa-n
Copy link
Member

@buyaa-n buyaa-n commented Sep 25, 2024

Add fuzzer for Convert.To/FromBase64*** APIs

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 25, 2024
@buyaa-n buyaa-n added area-System.Runtime and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Sep 25, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.

src/libraries/Fuzzing/DotnetFuzzing/Assert.cs Outdated Show resolved Hide resolved

namespace DotnetFuzzing.Fuzzers
{
internal sealed class ConvertToBase64Fuzzer : IFuzzer
Copy link
Member

Choose a reason for hiding this comment

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

This isn't covering that much logic, and the interesting inputs are the same as with Base64Fuzzer. Can we move the extra asserts into that one instead?

Copy link
Member Author

@buyaa-n buyaa-n Sep 25, 2024

Choose a reason for hiding this comment

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

Only Base64FormattingOptions.None path uses Base64 encoder, it has its own logic for other cases and also has logic for widening encoded char after calling Base64.EncodeTo***(...).

i.e there is some logic we want to be covered, plus I assume other Conver APIs fuzz tests will be added to this one

Copy link
Member

Choose a reason for hiding this comment

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

But the inputs are base64, so the interesting corner cases will be similar between base64 APIs on Convert, or on the Base64 class.

If we were to add more fuzz testing for other APIs on Convert, I don't think we'd want them to share the fuzz target with this one as the inputs for base64 parsing have nothing in common with interesting inputs for parsing an int32.

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
@lewing
Copy link
Member

lewing commented Sep 26, 2024

/azp run runtime

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@buyaa-n
Copy link
Member Author

buyaa-n commented Sep 26, 2024

@MihuBot fuzz ConvertToBase64

@MihaZupan
Copy link
Member

Fuzzing builds are currently broken as of #106599 being merged (+1 for #107204).

@buyaa-n
Copy link
Member Author

buyaa-n commented Sep 27, 2024

Fuzzing builds are currently broken as of #106599 being merged (+1 for #107204).

Yes, the MihaBot failed with that issue, I am trying to fix that

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

Successfully merging this pull request may close these issues.

3 participants