Toolvito

Works on this device

Mime Allowlist Checker

Check the media types (MIME types) that clients declare, such as the Content-Type of an upload, against the list of types you allow. The tool checks the syntax of each type, says which entry of your list allows it, and notes types that can hold scripts. A declared type is not proof of what a file holds.

Enter your values

Your values

One type on each line, or separated by commas. image/* allows every image type; */* allows every type.

One type on each line, as a browser or a client declares it, for example the Content-Type of an upload. Parameters such as charset may follow.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Check the types.

How to use the MIME allowlist checker

  1. Type the types you allow, one on each line, such as image/png. Use image/* to allow every image type.
  2. Type or paste the types to check, one on each line, as a client declares them. Parameters such as ; charset=utf-8 may follow.
  3. Choose Check the types. Each row shows the media type, the result, the syntax, the entry that allows it and notes.

The rules

  • A media type is type/subtype, then optional parameters ;name=value; a value with spaces is in double quotes (RFC 9110, section 8.3.1). No space is allowed around / or =.
  • Type and subtype follow the naming rule of RFC 6838, section 4.2: a letter or digit first, then letters, digits and ! # $ & - ^ _ . +, at most 127 characters.
  • Type and subtype are compared without regard to case: IMAGE/JPEG is image/jpeg. Parameters are shown but not compared.
  • image/* in your list allows every image type, and */* allows every type. This is the tool's rule, as in the Accept field.
  • The notes name the registration tree (vnd. vendor, prs. personal, x. unregistered, and the old x- form), a structured syntax suffix such as +xml, and a top-level type that is not registered.

A declared type is not proof

The sender chooses the type it declares, so image/png may arrive with any bytes. Check the first bytes of each upload (its file signature) yourself. Serve uploads with X-Content-Type-Options: nosniff, and with Content-Disposition: attachment where you can.

Some types can run scripts when a browser opens them from your site: text/html, application/xhtml+xml, image/svg+xml, XML types and JavaScript types. image/* in your list lets image/svg+xml through.

Worked example

With the starting lists, 4 of 12 lines are allowed: image/png, IMAGE/JPEG (read as image/jpeg), text/plain;charset="utf-8" (the parameter is shown as charset=utf-8) and application/pdf. image/jpg is refused and noted as not registered. The lines image/png, image/gif and image are not media types.

Limits you should know

  • The tool checks typed text. It does not read a file or test a server.
  • The list of registered top-level types is typed into the tool (application, audio, example, font, haptics, image, message, model, multipart, text, video). The tool does not check that a subtype is in the IANA registry.

Related tools