CVE-2020-5226: Simplesamlphp/simplesamlphp Cross-Site Scripting Vulnerability
LOWCVE-2020-5226 is a LOW (CVSS 4.4) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Simplesamlphp/simplesamlphp libraries in the Packagist ecosystem. The issue involves cross-site scripting in simplesamlphp. Remediation is available by upgrading affected packages to version 1.18.4.
CVE-2020-5226 at a Glance
Security Impact
CVSS: 4.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2020-5226
To remediate this vulnerability, upgrade all affected Simplesamlphp/simplesamlphp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade simplesamlphp/simplesamlphp to 1.18.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for simplesamlphp/simplesamlphp
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-5226, inspect your project dependencies for Simplesamlphp/simplesamlphp:
inspect dependencies for simplesamlphp/simplesamlphp
Analyze the terminal output to locate any version of Simplesamlphp/simplesamlphp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.18.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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Simplesamlphp/simplesamlphp, 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
CVE-2020-5226 Affected Simplesamlphp/simplesamlphp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
simplesamlphp/simplesamlphp
|
Packagist |
≥ 1.18.0
< 1.18.4
|
1.18.4
|
References
Frequently Asked Questions
What is CVE-2020-5226?
Which Simplesamlphp/simplesamlphp versions are affected?
What version fixes CVE-2020-5226?
Is simplesamlphp/simplesamlphp affected?
What is the CVSS score of CVE-2020-5226?
What CWE is associated with CVE-2020-5226?
How can I check Packagist dependencies for CVE-2020-5226?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mj9p-v2r8-wf8w",
"modified" : "2021-01-08T20:32:54Z",
"published" : "2020-01-24T21:26:54Z",
"aliases" : [ "CVE-2020-5226" ],
"summary" : "Cross-site scripting in SimpleSAMLphp",
"details" : "### Background\n\nSimpleSAMLphp allows users to report errors and failures to the system administrators via a web form. This web form gathers some contextual information automatically, but it also allows the user to provide their email address for follow-ups and a free-text explanation of what happened. Once submitted, the report is sent as an email to the administrative email address configured in the software.\n\n### Description\n\nThe `www/erroreport.php` script allows error reports to be submitted and sent to the system administrator. Starting with SimpleSAMLphp 1.18.0, a new `SimpleSAML\\Utils\\EMail` class was introduced to handle sending emails, implemented as a wrapper of an external dependency.\n\nThis new wrapper allows us to use Twig templates in order to create the email sent with an error report. Since Twig provides automatic escaping of variables, manual escaping of the free-text field in `www/errorreport.php` was removed to avoid double escaping. However, for those not using the new user interface yet, an email template is hardcoded into the class itself in plain PHP. Since no escaping is provided in this template, it is then possible to inject HTML inside the template by manually crafting the contents of the free-text field.\n\n### Affected versions\n\nSimpleSAMLphp versions 1.18.0 to 1.18.3, both inclusive.\n\n### Impact\n\nAn attacker may take advantage of this issue to manually craft a modified email sent via the error reporting mechanism, such as this email might trick a system administrator into performing an action, such as introducing their credentials into a phishing web site that resembles the original.\n\nRemote execution of javascript code is considered unfeasible since email clients do not run javascript present in emails, although there might be email clients which don't follow this rule, making the attack surface grow.\n\n### Resolution\n\nUpgrade the SimpleSAMLphp installation to version 1.18.4.\n\n### Credit\n\nThis vulnerability was discovered and reported by Frederic Vleminckx.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "simplesamlphp/simplesamlphp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.18.0"
}, {
"fixed" : "1.18.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/simplesamlphp/simplesamlphp/security/advisories/GHSA-mj9p-v2r8-wf8w"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5226"
}, {
"type" : "WEB",
"url" : "https://simplesamlphp.org/security/202001-01"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2020-01-24T21:09:37Z",
"nvd_published_at" : null
}
}