GitHub Advisoryadvisory · Packagist

GHSA-7mv4-4xpg-xq44 FormField with square brackets in field name skips validation

MEDIUM Published 2022-03-26 Modified 2022-03-26 Official page ↗
Aliases
CVE-2020-26138
Ecosystem
Packagist
Packages
silverstripe/framework
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Weaknesses
CWE-20
Reviewed
2022-03-26

Affected packages

• Packagist silverstripe/framework: >= 3.0.0, < 4.7.4 → fixed in 4.7.4

Description

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.

Related

Alias · CVE (1)

  • CVE-2020-26138 In SilverStripe through 4.6.0-rc1, a FormField with square brackets in the field name skips validation. vulnerability

Weakness · CWE (1)

  • CWE-20 Improper Input Validation weakness

References