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 Base64Url fuzzer #106509

Merged
merged 3 commits into from
Aug 22, 2024
Merged

Add Base64Url fuzzer #106509

merged 3 commits into from
Aug 22, 2024

Conversation

buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Aug 15, 2024

Add Base64UrlFuzzer.

Mostly covered char overloads as byte overloads quite similar and can be covered with Base64Fuzzer

@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 Aug 15, 2024
@buyaa-n buyaa-n added area-System.Buffers and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 16, 2024
Co-authored-by: Weihan Li <7604648+WeihanLi@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
@buyaa-n
Copy link
Contributor Author

buyaa-n commented Aug 17, 2024

@MihuBot fuzz base64url

@MihuBot
Copy link

MihuBot commented Aug 17, 2024

// Base64UrlFuzzer
System.Exception: Expected=Done Actual=InvalidData
   at DotnetFuzzing.Assert.<Equal>g__Throw|0_0[T](T expected, T actual) in D:\a\runtime-utils\runtime-utils\Runner\runtime\src\libraries\Fuzzing\DotnetFuzzing\Assert.cs:line 18
   at DotnetFuzzing.Assert.Equal[T](T expected, T actual) in D:\a\runtime-utils\runtime-utils\Runner\runtime\src\libraries\Fuzzing\DotnetFuzzing\Assert.cs:line 14
   at DotnetFuzzing.Fuzzers.Base64UrlFuzzer.FuzzTarget(ReadOnlySpan`1 bytes) in D:\a\runtime-utils\runtime-utils\Runner\runtime\src\libraries\Fuzzing\DotnetFuzzing\Fuzzers\Base64UrlFuzzer.cs:line 109
   at DotnetFuzzing.Program.<>c__DisplayClass1_0.<RunFuzzer>b__0(ReadOnlySpan`1 bytes) in D:\a\runtime-utils\runtime-utils\Runner\runtime\src\libraries\Fuzzing\DotnetFuzzing\Program.cs:line 91
   at SharpFuzz.Fuzzer.LibFuzzer.Run(ReadOnlySpanAction action, Boolean ignoreExceptions)
==9180== ERROR: libFuzzer: deadly signal
NOTE: libFuzzer has rudimentary signal handlers.
      Combine libFuzzer with AddressSanitizer or similar for better crash reports.
SUMMARY: libFuzzer: deadly signal
MS: 1 ChangeBinInt-; base unit: 80e1c23d46f468d00555be3fb48866ee6830798a
0x53,0x4d,0x3d,
SM=
artifact_prefix='./'; Test unit written to Base64UrlFuzzer-artifact-1
Base64: U009

@buyaa-n
Copy link
Contributor Author

buyaa-n commented Aug 21, 2024

The input that failed the fuzzer is Base64Url.IsValid("SM=") which supposed to return false, but returning true, the fix is up #106771

@buyaa-n
Copy link
Contributor Author

buyaa-n commented Aug 22, 2024

Last fuzz run with the bug fix #106771 succeeded, merging

@buyaa-n buyaa-n merged commit 06ae1be into dotnet:main Aug 22, 2024
80 of 84 checks passed
@buyaa-n buyaa-n deleted the base64url-fuzz branch August 22, 2024 15:47
@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants