CVE-2020-5225: Simplesamlphp/simplesamlphp Log Injection Vulnerability

LOW
Advisory Identifier: GHSA-6gc6-m364-85ww
CVSS 4.4
CWE-532
Published
Advisory Summary

CVE-2020-5225 is a LOW (CVSS 4.4) log injection vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Simplesamlphp/simplesamlphp libraries in the Packagist ecosystem. The issue involves log injection in simplesamlphp. Remediation is available by upgrading affected packages to version 1.18.4.

CVE-2020-5225 at a Glance

CVE Identifier CVE-2020-5225
GHSA Identifier GHSA-6gc6-m364-85ww
Severity LOW
CVSS v3.1 Base Score 4.4
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Simplesamlphp/simplesamlphp
Package Ecosystem Packagist
Published Date
Last Updated

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).

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

How to Fix CVE-2020-5225

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.

simplesamlphp/simplesamlphp fixed: 1.18.4
Upgrade simplesamlphp/simplesamlphp to 1.18.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 simplesamlphp/simplesamlphp

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-5225, 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-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. 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

### Background SimpleSAMLphp has a logging functionality that allows system administrators to keep track of the activity, errors, and statistics. Additionally, it allows users to report errors, shall they happen. An error report contains a report identifier, which is logged once submitted. ### Description The `www/erroreport.php` script, which receives error reports and sends them via email to the system administrator, didn't properly sanitize the report identifier obtained from the request. This allows an attacker, under specific circumstances, to inject new log lines by manually crafting this report ID. When configured to use the `file` logging handler, SimpleSAMLphp will output all its logs by appending each log line to a given file. Since the `reportID` parameter received in a request sent to `www/errorreport.php` was not properly sanitized, it was possible to inject newline characters into it, effectively allowing a malicious user to inject new log lines with arbitrary content. ### Affected versions SimpleSAMLphp versions up to **1.18.3**. ### Impact An attacker may use this issue to inject logs messages into a SimpleSAMLphp log file, trying to trick or confuse system administrators. However, the attack surface is considered small, as the attack will only work with the `file` logging handler, which opens the log file in _append-only_ mode. This means an attacker cannot edit or remove existing log messages, and even if non-ascii characters are written to the log, the file will always be readable with a simple text editor. ### Resolution Upgrade the SimpleSAMLphp installation to version **1.18.4**. ### Credit This vulnerability was discovered and reported by Frederic Vleminckx on January 23, 2020.

CVE-2020-5225 Affected Simplesamlphp/simplesamlphp Versions

1 component(s)
Fixed Versions:
1.18.4
Product / Package Ecosystem Affected Versions Fixed Version
simplesamlphp/simplesamlphp
Packagist
< 1.18.4
1.18.4

References

Frequently Asked Questions

What is CVE-2020-5225?
CVE-2020-5225 is a security vulnerability in Simplesamlphp/simplesamlphp involving Log injection in SimpleSAMLphp under CWE-532: Insertion of Sensitive Information into Log File.
Which Simplesamlphp/simplesamlphp versions are affected?
Affected versions include releases prior to 1.18.4 across affected packages: simplesamlphp/simplesamlphp.
What version fixes CVE-2020-5225?
Upgrading to 1.18.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is simplesamlphp/simplesamlphp affected?
Yes, simplesamlphp/simplesamlphp is affected in releases prior to 1.18.4. Upgrade your dependency to 1.18.4 or later.
What is the CVSS score of CVE-2020-5225?
CVE-2020-5225 has a CVSS v3.1 base score of 4.4 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2020-5225?
CVE-2020-5225 is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check Packagist dependencies for CVE-2020-5225?
Run the dependency tree command: 'inspect dependencies for simplesamlphp/simplesamlphp'. 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-6gc6-m364-85ww",
  "modified" : "2021-01-08T20:33:05Z",
  "published" : "2020-01-24T21:26:13Z",
  "aliases" : [ "CVE-2020-5225" ],
  "summary" : "Log injection in SimpleSAMLphp",
  "details" : "### Background\n\nSimpleSAMLphp has a logging functionality that allows system administrators to keep track of the activity, errors, and statistics. Additionally, it allows users to report errors, shall they happen. An error report contains a report identifier, which is logged once submitted.\n\n### Description\n\nThe `www/erroreport.php` script, which receives error reports and sends them via email to the system administrator, didn't properly sanitize the report identifier obtained from the request. This allows an attacker, under specific circumstances, to inject new log lines by manually crafting this report ID.\n\nWhen configured to use the `file` logging handler, SimpleSAMLphp will output all its logs by appending each log line to a given file. Since the `reportID` parameter received in a request sent to `www/errorreport.php` was not properly sanitized, it was possible to inject newline characters into it, effectively allowing a malicious user to inject new log lines with arbitrary content.\n\n### Affected versions\n\nSimpleSAMLphp versions up to **1.18.3**.\n\n### Impact\n\nAn attacker may use this issue to inject logs messages into a SimpleSAMLphp log file, trying to trick or confuse system administrators. However, the attack surface is considered small, as the attack will only work with the `file` logging handler, which opens the log file in _append-only_ mode. This means an attacker cannot edit or remove existing log messages, and even if non-ascii characters are written to the log, the file will always be readable with a simple text editor.\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 on January 23, 2020.",
  "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" : "0"
      }, {
        "fixed" : "1.18.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/simplesamlphp/simplesamlphp/security/advisories/GHSA-6gc6-m364-85ww"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5225"
  }, {
    "type" : "WEB",
    "url" : "https://simplesamlphp.org/security/202001-02"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-532" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-01-24T20:46:16Z",
    "nvd_published_at" : null
  }
}