CVE-2020-26138: Silverstripe/framework FormField With Square Brackets Vulnerability

MODERATE
Advisory Identifier: GHSA-7mv4-4xpg-xq44
CVSS 5.3
CWE-20
Published
Advisory Summary

CVE-2020-26138 is a MODERATE (CVSS 5.3) formfield with square brackets vulnerability (CWE-20: Improper Input Validation) affecting Silverstripe/framework libraries in the Packagist ecosystem. The issue involves formfield with square brackets in field name skips validation. Remediation is available by upgrading affected packages to version 4.7.4.

CVE-2020-26138 at a Glance

CVE Identifier CVE-2020-26138
GHSA Identifier GHSA-7mv4-4xpg-xq44
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-20: Improper Input Validation
Affected Product Silverstripe/framework
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2020-26138

To remediate this vulnerability, upgrade all affected Silverstripe/framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

silverstripe/framework fixed: 4.7.4
Upgrade silverstripe/framework to 4.7.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for silverstripe/framework

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-26138, inspect your project dependencies for Silverstripe/framework:

inspect dependencies for silverstripe/framework

Analyze the terminal output to locate any version of Silverstripe/framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.7.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Silverstripe/framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2020-26138 Affected Silverstripe/framework Versions

1 component(s)
Fixed Versions:
4.7.4
Product / Package Ecosystem Affected Versions Fixed Version
silverstripe/framework
Packagist
≥ 3.0.0
< 4.7.4
4.7.4

References

Frequently Asked Questions

What is CVE-2020-26138?
CVE-2020-26138 is a security vulnerability in Silverstripe/framework involving FormField with square brackets in field name skips validation under CWE-20: Improper Input Validation.
Which Silverstripe/framework versions are affected?
Affected versions include releases prior to 4.7.4 across affected packages: silverstripe/framework.
What version fixes CVE-2020-26138?
Upgrading to 4.7.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is silverstripe/framework affected?
Yes, silverstripe/framework is affected in releases prior to 4.7.4. Upgrade your dependency to 4.7.4 or later.
What is the CVSS score of CVE-2020-26138?
CVE-2020-26138 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2020-26138?
CVE-2020-26138 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Packagist dependencies for CVE-2020-26138?
Run the dependency tree command: 'inspect dependencies for silverstripe/framework'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7mv4-4xpg-xq44",
  "modified" : "2022-03-26T00:14:34Z",
  "published" : "2022-03-26T00:14:34Z",
  "aliases" : [ "CVE-2020-26138" ],
  "summary" : "FormField with square brackets in field name skips validation",
  "details" : "FileField with array notation skips validation\n\nThe 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.\n\nPHP 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.\n\nIn 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" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "silverstripe/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "4.7.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-26138"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/silverstripe/framework/CVE-2020-26138.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://www.silverstripe.org/download/security-releases/cve-2020-26138"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-26T00:14:34Z",
    "nvd_published_at" : null
  }
}