VDB
Sign up
MEDIUM5.3

GHSA-7mv4-4xpg-xq44

FormField with square brackets in field name skips validation

Quick fix

GHSA-7mv4-4xpg-xq44 — silverstripe/framework: upgrade to the fixed version with the command below.

composer require silverstripe/framework:^4.7.4

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

Packagist/silverstripe/framework
Introduced in: 3.0.0Fixed in: 4.7.4
Fixcomposer require silverstripe/framework:^4.7.4

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:composer/silverstripe/framework"]}'