sharpfuzz icon indicating copy to clipboard operation
sharpfuzz copied to clipboard

Fixes issue with obfuscated libraries failing instrumentation

Open Static-Flow opened this issue 2 years ago • 1 comments

This is an attempt at fixing issue #54

Static-Flow avatar Dec 01 '23 01:12 Static-Flow

Hmm unclear if this might just be masking the problem. This gets past instrumentation but then fails on fuzzing like so:

Unhandled exception. System.TypeInitializationException: The type initializer for '<Module>' threw an exception.
 ---> System.InvalidProgramException: Common Language Runtime detected an invalid program.
   at Iron.Pdf.Extensions.feqyia.elnidp()
   at .cctor()
   --- End of inner exception stack trace ---
   at IronPdfFuzz.IronPdfFuzzing.<>c.<Main>b__0_0(String stream)
   at SharpFuzz.Fuzzer.<>c__DisplayClass11_0.<Wrap>b__0(Stream stream)
   at SharpFuzz.Fuzzer.RunWithoutAflFuzz(Action`1 action, Stream stream)
   at SharpFuzz.Fuzzer.OutOfProcess.Run(Action`1 action)
   at SharpFuzz.Fuzzer.OutOfProcess.Run(Action`1 action, Int32 bufferSize)

with a very simple fuzz harness:

        static void Main(string[] args)
     {
         var renderer = new IronPdf.HtmlToPdf();
         Fuzzer.OutOfProcess.Run(stream =>
         {
             Console.WriteLine(stream);
             string fileContents = File.ReadAllText(stream);
             Console.WriteLine(fileContents);
             renderer.RenderHtmlAsPdf(fileContents);
         });
     }
     ```

Static-Flow avatar Dec 01 '23 01:12 Static-Flow