Skip to content

Images with Polyglot attacks cause Access Violation Exception #922

@sport-monkey

Description

@sport-monkey

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

When attempting to load a JPEG with a polyglot attack Image.Load throws an AccessViolationException. I've tried uploading the images directly but they appear to be cleaned - Images can be found here as well as some further examples on the previous link

This also stops the image reading after a given point in latest NuGet package (1.0.0-beta0006).
You also get some really interesting side effects by evaluating frame.GetPixelSpan().Slice(1390000, 5) and $"{frame.GetPixelSpan()[1390000]" whilst in Debug

Steps to Reproduce

Call Image.Load on attached files

System Configuration

  • ImageSharp version: SixLabors.ImageSharp.1.0.0-dev002709
  • Other ImageSharp packages and versions: SixLabors.Core.1.0.0-dev000108
  • Environment (Operating system, version and so on): OS X 10,13.2
  • .NET Framework version: core 3 preview 5
  • Additional information:

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions