MediumGHSA-97jm-g33h-f46g

silverstripe/framework ReadOnly transformation for formfields exploitable

Published 23 May 2024 · Updated 28 Nov 2024

Affected packages

Affected
<3.1.21
Fixed in
3.1.21
Update to the fixed version for your release line, for example:composer require silverstripe/framework:^3.1.21
Affected
>=3.2.0 <3.2.6
Fixed in
3.2.6
Update to the fixed version for your release line, for example:composer require silverstripe/framework:^3.2.6
Affected
>=3.3.0 <3.3.4
Fixed in
3.3.4
Update to the fixed version for your release line, for example:composer require silverstripe/framework:^3.3.4
Affected
>=3.4.0 <3.4.2
Fixed in
3.4.2
Update to the fixed version for your release line, for example:composer require silverstripe/framework:^3.4.2

Details

Form fields returning isReadonly() as true are vulnerable to reflected XSS injections. This includes ReadonlyField, LookupField, HTMLReadonlyField, as well as special purpose fields like TimeField_Readonly. Values submitted to through these form fields are not filtered out from the form session data, and might be shown to the user depending on the form behaviour. For example, form validation errors cause the form to re-render with previously submitted values by default.

SilverStripe forms automatically load values from request data (GET and POST), which enables malicious use of URLs if your form uses these fields and doesn't overwrite data on form construction.

Readonly and disabled form fields are already filtered out in Form->saveInto(), so maliciously submitted data on these fields doesn't make it into the database unless you are accessing form values directly in your saving logic.

Is GHSA-97jm-g33h-f46g in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected silverstripe/framework, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.