Advisory

GHSA-7mv4-4xpg-xq44

Also known as: BIT-silverstripe-2020-26138, CVE-2020-26138

Summary

FormField with square brackets in field name skips validation

Details

FileField with array notation skips validation

The FileField class is commonly used for file upload in custom code on a Silverstripe website. This field is designed to be used with a single file upload.

PHP allows for submitting multiple values by adding square brackets to the field name. When this is done to a FileField, it will be coerced into allowing multiple files by using this notation. This is not a supported feature, though nothing is done to prevent this.

In this scenario, validation such as limiting allowed extensions is not applied, and the FileField->saveInto() behaviour is not triggered. If custom controller logic is used to process the file uploads, it might implicitly rely on validation to be provided by the Form system, which is not the case.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2022-03-26 00:14 UTC
Modified
2024-02-17 05:35 UTC

Affected packages and fixes

silverstripe/framework

Packagist · All systems

Affected

  • introduced 3.0.0, fixed 4.7.4 (ecosystem)

Fixed versions

4.7.4

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences