File Security Scans

Every file uploaded to BioT is scanned. BioT compares the content of the file with the file type it was declared as, and scans it for malware.

The scans run in the background, within seconds of the upload. Uploading a file and attaching it to an entity never waits for the scans and is never rejected by them. A file that a scan blocks is never served.

An organization logo, favicon, or theme is not published until its scans finish. Until then, the previous one stays in place.

File Status

Each file receives a status from its scans. The status is the most severe result of all the scans on that file.

StatusMeaningCan the file be opened?What the portals show
PASSEDAll scans passedYesThe file is shown as usual
WARNINGA scan found something minor, or could not read the fileYesA warning icon with the reason on hover. A file downloads as usual. An image is not loaded automatically and opens when you click Show
SCANNINGA scan has not answered yet, usually a few secondsNo, not until the scans finishScanning
BLOCKEDThe content of the file is not allowed, for example, a web page declared as an imageNoBlocked, with the reason on hover and no download
QUARANTINEDMalware was found in the fileNoThe same as a blocked file

Reading the Status Through the API

Every file and image value returned by the API carries the result of its scans. For the full response, see the file API reference:

{
  "analysis_file": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "report.pdf",
    "accessible": true,
    "scans": {
      "status": "WARNING",
      "done": 2,
      "total": 2,
      "reason": {
        "scan": "TYPE",
        "result": "MISMATCH",
        "detail": "image/png"
      }
    }
  }
}
  • status: the status of the file, as described in the table above.
  • done and total: how far the scans have gone, for example 1 of 2. When done equals total, every scan has answered, and the status is final.
  • reason: an object that says why the file has the status it has now. scan is the scan that set the status, for example, ANTIVIRUS or TYPE. result is what that scan found, for example, INFECTED, ACTIVE_CONTENT, or MISMATCH. detail explains the result, for example, the type that was detected. If more than one scan reported something, the reason is the one behind the most severe result.
  • accessible: whether BioT will give you a link to download this file. It is false while the file is still being scanned, and for a blocked or quarantined file. When it is false, signedUrl is null.

What Your Code Should Handle

  • A blocked or quarantined file returns 403 FILE_BLOCKED when you request a download. The response carries the status and the reason.
  • A file cannot be downloaded until its scans finish. A download request in the first seconds after the upload returns 409 FILE_BEING_SCANNED. Wait a second or two and request it again.

Every successful download response carries the scans and accessible fields, the same fields that come with the file on every entity read.

If you have an interceptor plugin on the download API, note that while a file is being scanned, the portals request it again several times until the status settles, and each request runs your interceptor. You will see more calls than before for such files. Nothing needs to change in the plugin.

Uploading Files With the Correct Type

BioT compares the content of each uploaded file with the type you declared in mimeType when you created the file, see File Upload.

  • Content that matches the declared type passes.
  • A harmless mismatch, for example, a PNG declared as a JPEG, receives a warning. The file can still be downloaded.
  • Active content declared as another type is blocked. Active content is a file that runs when it is opened: a web page, an SVG image, a script or a program.
  • A file uploaded as application/octet-stream, which means that the type is unknown, is scanned for active content only.

If your device or application uploads SVG images or web pages, declare them correctly: image/svg+xml for an SVG image, and text/html for a web page. Upload a file that was blocked for this reason again, with the correct type.

Files Found to Contain Malware

A file found to contain malware is quarantined:

  • Nobody receives a download link for it, and links that were issued earlier stop working.
  • The file is not deleted.
  • Uploading the same file again gives it a new ID and the same result.

Only BioT Support can release a quarantined file. If you believe a file was quarantined by mistake, open a support request and the team will look into this, see Customer Support.


Did this page help you?